rstackjs / rstackjs/rsbuild-plugin-vue2

Behavior of :deep syntax in <style lang='less' scoped> differs from Webpack implementation

Open
#12 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
6
Forks
2
Avg merge
3h 49m
Merged PRs (30d)
7

Description

// app.vue
<template>
  <div class="content">
    <Com />
  </div>
</template>
<script setup lang="ts">
import Com from './Com.vue';
</script>

<style scoped lang="less">
.content {
   :deep(.Com) {
    &-title {
      font-size: 3rem;
    }
  }
}
</style>
// Com.vue
<template>
  <div class="Com">
    <div class="Com-title">Component</div>
  </div>
</template>

Expected .Com-title to have font-size: 3rem, but the style doesn't penetrate when using Vue's recommended :deep(x) syntax. However, using ::v-deep works normally.

https://github.com/ununian/less-deep-demo

::v-deep

Image

:deep()

Image

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the behavior from the linked less-deep-demo using the provided app.vue and Com.vue examples. Compare the generated styling for :deep(.Com) with the working ::v-deep form; done means the .Com-title rule applies with font-size: 3rem under the scoped less style.

Written by the indexing model from the issue text.

Assessment

Tech stack
webpack
Domain
build-system, frontend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.