Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[bug] :deep Compilation error #871

Open
lzxb opened this issue Dec 13, 2024 · 5 comments
Open

[bug] :deep Compilation error #871

lzxb opened this issue Dec 13, 2024 · 5 comments

Comments

@lzxb
Copy link

lzxb commented Dec 13, 2024

Less source code

.faq-desc :deep(.ui-collapse) {
  &-item-content {
    border-bottom-width: 0;
  }
}

Compile into CSS

.faq-desc :deep(.ui-collapse) {
  border-bottom-width: 0;
}
.faq-desc :deep(.ui-collapse)-item-content {
  border-bottom-width: 0;
}

Will report an error,in "lightningcss": "^1.28.2",

import { transform } from 'lightningcss';

transform({
  filename: 'style.css',
  code: Buffer.from(`
.faq-desc :deep(.ui-collapse) {
  border-bottom-width: 0;
}
.faq-desc :deep(.ui-collapse)-item-content {
  border-bottom-width: 0;
}

`),
  minify: true,
  sourceMap: true
});
@lzxb lzxb changed the title :deep Compilation error [bug] :deep Compilation error Dec 13, 2024
@devongovett
Copy link
Member

Shouldn't that syntax be compiled by Vue before it reaches lightningcss? That is not valid CSS syntax.

@lzxb
Copy link
Author

lzxb commented Dec 17, 2024

Vue loader always handles it last

      {
        test: /\.less$/,
        use: ['vue-style-loader', 'css-loader', 'less-loader'],
        type: 'javascript/auto',
      },

@devongovett
Copy link
Member

Why? Shouldn't it run first?

@lzxb
Copy link
Author

lzxb commented Dec 22, 2024

Rspack related documentation always requires this to be written.

@lzxb
Copy link
Author

lzxb commented Dec 22, 2024

See detail: https://rspack.dev/guide/tech/vue#vue-3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants