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

fix(class references): experimentalResolveStyleCssClasses regression #3689

Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/language-core/src/generators/script.ts
Expand Up @@ -856,7 +856,7 @@ declare function defineProp<T>(value?: T | (() => T), required?: boolean, rest?:
for (let i = 0; i < styles.length; i++) {
const style = styles[i];
const option = vueCompilerOptions.experimentalResolveStyleCssClasses;
if ((option === 'always' || option === 'scoped') && style.scoped) {
if (option === 'always' || (option === 'scoped' && style.scoped)) {
for (const className of style.classNames) {
generateCssClassProperty(
i,
Expand Down
2 changes: 1 addition & 1 deletion packages/language-core/src/plugins/vue-tsx.ts
Expand Up @@ -160,7 +160,7 @@ function createTsx(fileName: string, _sfc: Sfc, { vueCompilerOptions, compilerOp

for (const style of _sfc.styles) {
const option = vueCompilerOptions.experimentalResolveStyleCssClasses;
if ((option === 'always' || option === 'scoped') && style.scoped) {
if (option === 'always' || (option === 'scoped' && style.scoped)) {
Copy link
Contributor Author

@Ilanaya Ilanaya Oct 25, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just for reference, the code some lines above was initially correct

for (const className of style.classNames) {
classes.add(className.text.substring(1));
}
Expand Down