Skip to content

Commit

Permalink
doc(css-module): update README example (#11)
Browse files Browse the repository at this point in the history
Per #7
  • Loading branch information
JakobJingleheimer authored Jul 2, 2024
1 parent 2e75e83 commit b948c6b
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,11 +104,23 @@ This loads the module as a plain-object of simple key-value pairs of the css spe
```css
/* main.module.css */
#Bar { font-weight: bold }
.Foo { text-decoration: none }

.Foo {
text-decoration: none

.Baz { color: red }
}

.Qux .Zed { font-size: 1.1em }
```

```js
import styles from 'main.module.css'; // styles = { Bar: 'Bar', Foo: 'Foo' }
import styles from 'main.module.css';

styles.Bar; // 'Bar'
styles.Baz; // 'Baz'
styles.Foo; // 'Foo'
styles.Zed; // 'Zed'
```

This ensures snapshots are unaffected by unrelated changes.
Expand Down

0 comments on commit b948c6b

Please sign in to comment.