Skip to content

Commit f9b0450

Browse files
committed
feat: Add documentation for renaming style rules
This commit introduces a new section in the README that explains how to rename style rules by query selector. It includes examples of CSS and Svelte code, and shows how the code gets converted after renaming.
1 parent c4643d1 commit f9b0450

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed

README.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,5 +83,41 @@ div { color: green; }
8383
</style>
8484
```
8585

86+
### Rename Style Rules by Query Selector
87+
88+
You can rename style rules by query selector.
89+
90+
For example, the following CSS and Svelte:
91+
92+
```css
93+
/* a.css */
94+
95+
div { color: red; }
96+
97+
.m0 { color: blue; }
98+
```
99+
100+
```svelte
101+
<p class="m1"> world </p>
102+
103+
<style>
104+
@import "./a.css?.m0=.m1" scoped;
105+
106+
div { color: green; }
107+
</style>
108+
```
109+
110+
will get converted into:
111+
112+
```svelte
113+
<p class="m1"> world </p>
114+
115+
<style>
116+
.m1 { color: blue; }
117+
118+
div { color: green; }
119+
</style>
120+
```
121+
86122
## License
87123
[MIT](./LICENSE)

0 commit comments

Comments
 (0)