Skip to content

Commit 43a8f75

Browse files
illrightkaisermann
authored andcommitted
docs: document the addition and add a notice about :local
1 parent e50bc2a commit 43a8f75

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

Diff for: README.md

+24
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,30 @@ _Note<sup>1</sup>: needs postcss to be installed_
9393

9494
_Note<sup>2</sup>: if you're using it as a standalone processor, it works best if added to the end of the processors array._
9595

96+
_Note<sup>3</sup>: if you need to have some styles be scoped inside a global style tag, use `:local` in the same way you'd use `:global`._
97+
98+
### Global rule
99+
100+
Use a `@global` rule to only expose parts of the stylesheet:
101+
102+
```html
103+
<style lang="scss">
104+
.scoped-style {}
105+
106+
@global {
107+
import 'global-stylesheet.css';
108+
109+
.global-style {
110+
.global-child-style {}
111+
}
112+
}
113+
</style>
114+
```
115+
116+
_Note<sup>1</sup>: needs postcss to be installed_
117+
118+
_Note<sup>2</sup>: if you're using it as a standalone processor, it works best if added to the end of the processors array._
119+
96120
### Preprocessors
97121

98122
Current supported out-of-the-box preprocessors are `SCSS`, `Stylus`, `Less`, `Coffeescript`, `TypeScript`, `Pug`, `PostCSS`, `Babel`.

0 commit comments

Comments
 (0)