You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+21-1Lines changed: 21 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,7 +12,7 @@ for [CSS Modules](https://github.com/css-modules/css-modules).
12
12
This project was inspired by this [`create-react-app` issue](https://github.com/facebook/create-react-app/issues/5677)
13
13
and was based on [`css-module-types`](https://github.com/timothykang/css-module-types).
14
14
15
-
## Usage
15
+
## Installation
16
16
17
17
To install with Yarn:
18
18
@@ -36,6 +36,26 @@ Once installed, add this plugin to your `tsconfig.json`:
36
36
}
37
37
```
38
38
39
+
### Importing CSS
40
+
41
+
A default export is always provided for your CSS module.
42
+
43
+
```tsx
44
+
importstylesfrom'my.module.css';
45
+
46
+
const a =styles.myClass;
47
+
const b =styles['my_other-class'];
48
+
```
49
+
50
+
As of version 1.1.0, you can also use named exports for classes that don't contain hyphens or underscores. You can still access other classes via the default export.
0 commit comments