Skip to content

Commit a07dae0

Browse files
committed
Mention :export in the readme
1 parent 8eb6717 commit a07dae0

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

README.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,33 @@ transform(`
7171
}
7272
```
7373

74+
### CSS Modules :export block
75+
76+
Parsing the [CSS Modules (ICSS) :export](https://github.com/css-modules/icss#export) is supported. The `:export` is often used to share variables from CSS or from a preprocessor like Sass/Less/Stylus to Javascript:
77+
78+
```js
79+
transform(`
80+
.foo {
81+
color: #f00;
82+
}
83+
84+
:export {
85+
myProp: #fff;
86+
}
87+
`);
88+
```
89+
90+
↓ ↓ ↓ ↓ ↓ ↓
91+
92+
```js
93+
{
94+
foo: {
95+
color: "#f00";
96+
},
97+
myProp: "#fff";
98+
}
99+
```
100+
74101
### CSS Media Queries (experimental)
75102

76103
_The API and parsed syntax for CSS Media Queries might change in the future_

0 commit comments

Comments
 (0)