Skip to content

Commit 90eb44d

Browse files
authored
postcss-global-data : set postcss 'from' option (#846)
1 parent 0e09053 commit 90eb44d

File tree

19 files changed

+1258
-180
lines changed

19 files changed

+1258
-180
lines changed

e2e/browserslist/package-json/index.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import assert from 'assert';
22
import plugin from 'postcss-preset-env';
33
import postcss from 'postcss';
44

5-
const result = await postcss([plugin()]).process(':any-link { color: blue; }').css;
5+
const result = (await postcss([plugin()]).process(':any-link { color: blue; }')).css;
66

77
if (process.env.BROWSERSLIST_ENV === 'production') {
88
assert.equal(
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
v18.8.0
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
@media (min-width: 768px) {
2+
body {
3+
color: green;
4+
}
5+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
@design-tokens url('./tokens.json') format('style-dictionary3');
2+
3+
@custom-media --tablet (min-width: design-token('viewport-tablet' to px));
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
"name": "@csstools/interop--custom-media--design-tokens--global-data",
3+
"version": "0.0.0",
4+
"private": true,
5+
"description": "Can you use custom-media, design-tokens and global-data together?",
6+
"scripts": {
7+
"build": "postcss style.css -o ./result.css",
8+
"test": "node ./test.mjs"
9+
},
10+
"devDependencies": {
11+
"@csstools/postcss-design-tokens": "file:../../../plugins/postcss-design-tokens",
12+
"@csstools/postcss-global-data": "file:../../../plugins/postcss-global-data",
13+
"postcss-cli": "^10.1.0",
14+
"postcss-custom-media": "file:../../../plugins/postcss-custom-media"
15+
},
16+
"volta": {
17+
"extends": "../../package.json"
18+
}
19+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
export default () => ({
2+
map: false,
3+
plugins: {
4+
'@csstools/postcss-global-data': {
5+
files: [
6+
'./media-queries.css',
7+
],
8+
},
9+
'@csstools/postcss-design-tokens': {},
10+
'postcss-custom-media': {},
11+
},
12+
});
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
@media (min-width: 768px) {
2+
body {
3+
color: green;
4+
}
5+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
@media (--tablet) {
2+
body {
3+
color: green;
4+
}
5+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import assert from 'assert';
2+
import fs from 'fs/promises';
3+
4+
const result = await fs.readFile('./result.css');
5+
const expect = await fs.readFile('./expect.css');
6+
7+
assert.equal(result.toString(), expect.toString());
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"viewport-tablet": {
3+
"value": 768
4+
}
5+
}

0 commit comments

Comments
 (0)