You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jan 18, 2022. It is now read-only.
* Use hash-sum and postcss-selector-parser for scoped css
* Transform css to add scope id
* Inject scope id component options object
* Add test for scoped css
* Fix lint errors
* Split processScript function to reduce complexity
* Unify scope id among various environment
* Comma is missing
* Update Scoped CSS docs
* Change warning tips for scoped styles
There is another option to modularize your component styles that called Scoped CSS. ScopedCSS will add a unique attribute to all HTML elements and CSS selectors instead of transform classnames. To enable this, you need to add `scoped` attribute to `<style>` tag.
204
+
205
+
For example, if you write following CSSin your component:
206
+
207
+
``` vue
208
+
<style scoped>
209
+
.red {
210
+
color: red;
211
+
}
212
+
213
+
.container .text {
214
+
font-size: 1.8rem;
215
+
}
216
+
</style>
217
+
```
218
+
219
+
The output CSS will be like:
220
+
221
+
``` css
222
+
.red[data-v-07bdddea] {
223
+
color: red;
224
+
}
225
+
226
+
.container .text[data-v-07bdddea] {
227
+
font-size: 1.8rem;
228
+
}
229
+
```
230
+
198
231
### Template
199
232
Templates are processed into `render`function by default. You can disable this by setting:
0 commit comments