Skip to content

Commit 726fb56

Browse files
authored
Merge pull request #5 from ryoppippi/fix-docs
fix docs
2 parents 86ec12c + 92d311f commit 726fb56

File tree

1 file changed

+41
-2
lines changed

1 file changed

+41
-2
lines changed

README.md

Lines changed: 41 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ Now you can use `@import "./whatever.css" scoped;`.
2424

2525
For example, the following CSS:
2626

27-
```html
27+
```svelte
2828
<style>
2929
@import "./a.css" scoped;
3030
@import "./b.css" scoped;
@@ -35,7 +35,7 @@ For example, the following CSS:
3535

3636
will get converted into:
3737

38-
```html
38+
```svelte
3939
<style>
4040
contents of a.css will be here
4141
contents of b.css will be here
@@ -44,5 +44,44 @@ contents of b.css will be here
4444
</style>
4545
```
4646

47+
### Select Style Rules by Query Selector
48+
49+
You can select style rules by query selector.
50+
51+
For example, the following CSS and Svelte:
52+
53+
54+
```css
55+
/* a.css */
56+
57+
div { color: red; }
58+
59+
.message { color: blue; }
60+
```
61+
62+
```svelte
63+
<div> hello </div>
64+
<p class="message"> world </p>
65+
66+
<style>
67+
@import "./a.css?.message" scoped;
68+
69+
div { color: green; }
70+
</style>
71+
```
72+
73+
will get converted into:
74+
75+
```svelte
76+
<div> hello </div>
77+
<p class="message"> world </p>
78+
79+
<style>
80+
.message { color: blue; }
81+
82+
div { color: green; }
83+
</style>
84+
```
85+
4786
## License
4887
[MIT](./LICENSE)

0 commit comments

Comments
 (0)