Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support for scoping variables in CSS modules (#8122)
- Loading branch information
1 parent
33562b6
commit 03cc465
Showing
23 changed files
with
253 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 3 additions & 0 deletions
3
packages/core/integration-tests/test/integration/css-modules-global/a/index.css
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
.foo { | ||
color: red; | ||
} |
4 changes: 4 additions & 0 deletions
4
packages/core/integration-tests/test/integration/css-modules-global/a/index.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
var foo = require('./index.css'); | ||
require('test/index.css'); | ||
|
||
output = foo.foo; |
3 changes: 3 additions & 0 deletions
3
.../core/integration-tests/test/integration/css-modules-global/a/node_modules/test/index.css
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
3 changes: 3 additions & 0 deletions
3
...re/integration-tests/test/integration/css-modules-global/a/node_modules/test/package.json
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
5 changes: 5 additions & 0 deletions
5
packages/core/integration-tests/test/integration/css-modules-global/a/package.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"@parcel/transformer-css": { | ||
"cssModules": true | ||
} | ||
} |
Empty file.
3 changes: 3 additions & 0 deletions
3
packages/core/integration-tests/test/integration/css-modules-global/b/index.css
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
.foo { | ||
color: red; | ||
} |
4 changes: 4 additions & 0 deletions
4
packages/core/integration-tests/test/integration/css-modules-global/b/index.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
var foo = require('./index.css'); | ||
require('test/index.css'); | ||
|
||
output = foo.foo; |
3 changes: 3 additions & 0 deletions
3
.../core/integration-tests/test/integration/css-modules-global/b/node_modules/test/index.css
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
3 changes: 3 additions & 0 deletions
3
...re/integration-tests/test/integration/css-modules-global/b/node_modules/test/package.json
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
7 changes: 7 additions & 0 deletions
7
packages/core/integration-tests/test/integration/css-modules-global/b/package.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"@parcel/transformer-css": { | ||
"cssModules": { | ||
"global": true | ||
} | ||
} | ||
} |
Empty file.
4 changes: 4 additions & 0 deletions
4
packages/core/integration-tests/test/integration/css-modules-vars/index.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
var foo = require('./index.module.css'); | ||
var vars = require('./vars.module.css'); | ||
|
||
output = [foo.foo, vars['--from-js']]; |
5 changes: 5 additions & 0 deletions
5
packages/core/integration-tests/test/integration/css-modules-vars/index.module.css
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
.foo { | ||
color: var(--color from "./vars.module.css"); | ||
width: var(--theme-sizes-1\/12 from "./vars.module.css"); | ||
height: var(--height from global); | ||
} |
7 changes: 7 additions & 0 deletions
7
packages/core/integration-tests/test/integration/css-modules-vars/package.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"@parcel/transformer-css": { | ||
"cssModules": { | ||
"dashedIdents": true | ||
} | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
packages/core/integration-tests/test/integration/css-modules-vars/vars.module.css
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
:root { | ||
--color: red; | ||
--font: Helvetica; | ||
--theme-sizes-1\/12: 2; | ||
--from-js: purple; | ||
--unused: green; | ||
} | ||
|
||
body { | ||
font: var(--font); | ||
} |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.