rollup-plugin-react-scoped-css 1.0.0-alpha.3 → 1.0.0-alpha.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -2
- package/dist/css/scope-css.js +4 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -37,7 +37,7 @@ Due to the way this plugin is working, it will apply the scope to the file and n
|
|
|
37
37
|
### Deep selector
|
|
38
38
|
If you want a selector in scoped styles to be "deep", i.e. affecting child components, you can use the ::deep combinator:
|
|
39
39
|
```css
|
|
40
|
-
.a
|
|
40
|
+
.a::deep .b { /* ... */ }
|
|
41
41
|
```
|
|
42
42
|
The above will be compiled into:
|
|
43
43
|
```css
|
|
@@ -47,7 +47,7 @@ Another exepted format, which will generate the same resutl, is:
|
|
|
47
47
|
```scss
|
|
48
48
|
.a::v-deep .b { /* ... */ }
|
|
49
49
|
```
|
|
50
|
-
This is primarly for backwards compatibility, we recommend the
|
|
50
|
+
This is primarly for backwards compatibility, we recommend the `::deep` selector.
|
|
51
51
|
### Dynamically Generated Content
|
|
52
52
|
DOM content created with dangerouslySetInnerHTML are not affected by scoped styles, but you can still style them using deep selectors.
|
|
53
53
|
|
|
@@ -145,3 +145,4 @@ export default {
|
|
|
145
145
|
|
|
146
146
|
## Contributing
|
|
147
147
|
Anyone is free to open a PR and contribute to this project... just be civilized!
|
|
148
|
+
|
package/dist/css/scope-css.js
CHANGED
|
@@ -16,9 +16,11 @@ function scopeCss(css, filename, hash) {
|
|
|
16
16
|
const isChainedSelector = (item) => {
|
|
17
17
|
return ((item?.data?.type === "TypeSelector" ||
|
|
18
18
|
item?.data?.type === "ClassSelector" ||
|
|
19
|
-
item?.data?.type === "AttributeSelector"
|
|
19
|
+
item?.data?.type === "AttributeSelector" ||
|
|
20
|
+
item?.data?.type === "IdSelector") &&
|
|
20
21
|
(item?.next?.data?.type === "ClassSelector" ||
|
|
21
|
-
item?.next?.data?.type === "AttributeSelector"
|
|
22
|
+
item?.next?.data?.type === "AttributeSelector" ||
|
|
23
|
+
item?.next?.data?.type === "IdSelector"));
|
|
22
24
|
};
|
|
23
25
|
const isCombinator = (item) => {
|
|
24
26
|
return item?.data?.type === "Combinator";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "rollup-plugin-react-scoped-css",
|
|
3
|
-
"version": "1.0.0-alpha.
|
|
3
|
+
"version": "1.0.0-alpha.5",
|
|
4
4
|
"description": "A rollup plugin designed to allow scoped css to be run in react (Compatible with vite and rollup)",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|