Skip to content

Commit

Permalink
Allow processing of @container at-rule, add tests for it
Browse files Browse the repository at this point in the history
  • Loading branch information
Vlad Yelahin committed Mar 5, 2024
1 parent 82ff87f commit 28f234a
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
4 changes: 4 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,10 @@ const factory = ({
// eslint-disable-next-line no-param-reassign
node.params = replaceValueSymbols(node.params, definitions);
},
container(node) {
// eslint-disable-next-line no-param-reassign
node.params = replaceValueSymbols(node.params, definitions);
},
value(node) {
if (noEmitExports) {
node.remove();
Expand Down
8 changes: 8 additions & 0 deletions index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,14 @@ test('should replace inside media queries', async (t) => {
);
});

test('should replace inside container queries', async (t) => {
await run(
t,
'@value base: 10px;\n@container (min-width: calc(base * 200)) {}',
'@value base: 10px;\n@container (min-width: calc(10px * 200)) {}',
);
});

test('should allow custom-property-style names', async (t) => {
await run(
t,
Expand Down

0 comments on commit 28f234a

Please sign in to comment.