Skip to content

Commit

Permalink
feat!: no transform or global for multi selector
Browse files Browse the repository at this point in the history
  • Loading branch information
idoros committed Sep 28, 2023
1 parent f3a8d66 commit 2bc9b34
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
1 change: 1 addition & 0 deletions packages/core/src/features/css-class.ts
Original file line number Diff line number Diff line change
Expand Up @@ -668,6 +668,7 @@ function parseStGlobal(
context.diagnostics.report(diagnostics.UNSUPPORTED_MULTI_SELECTORS_ST_GLOBAL(), {
node: decl,
});
return;
} else {
for (const node of selector[0].nodes) {
if (node.type === 'combinator') {
Expand Down
8 changes: 3 additions & 5 deletions packages/core/test/features/css-class.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ describe(`features/css-class`, () => {
-st-global: "";
}
/* @rule(empty) .y */
/* @rule(multi) .entry__b */
.b {
/* @analyze-error(multi) ${classDiagnostics.UNSUPPORTED_MULTI_SELECTORS_ST_GLOBAL()} */
-st-global: ".y , .z";
Expand All @@ -214,13 +214,11 @@ describe(`features/css-class`, () => {
const { meta, exports } = sheets['/entry.st.css'];

// meta.globals
expect(meta.globals).to.eql({
y: true,
});
expect(meta.globals).to.eql({});

// JS exports
expect(exports.classes.a, `a (empty) JS export`).to.eql(`entry__a`);
expect(exports.classes.b, `b (multi) JS export`).to.eql(`y`);
expect(exports.classes.b, `b (multi) JS export`).to.eql(`entry__b`);
expect(exports.classes.c, `c (complex) JS export`).to.eql(`entry__c`);
});
it(`should escape`, () => {
Expand Down

0 comments on commit 2bc9b34

Please sign in to comment.