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
Copy file name to clipboardExpand all lines: README.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -139,6 +139,7 @@ Currently supported and possible future features (in no particular order) are:
139
139
-[x] Easy localization with vue-i18n out-of-the-box integration, auto-detection, server-side injection and key-in-hand ui 
140
140
-[x] Easy state management with vuex integration 
141
141
-[x] Use Blaze templates in your vue app 
142
+
-[x]`module` attribute on `<style>` in .vue files
142
143
-[ ]*Typescript official integration in .vue files*
Copy file name to clipboardExpand all lines: packages/vue-component/README.md
+29Lines changed: 29 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -72,6 +72,32 @@ a {
72
72
</style>
73
73
```
74
74
75
+
### CSS Modules
76
+
77
+
As an alternative to scoped styles, you can use CSS modules to scope your CSS to your components by adding the `module` attribute to any `<style>` tag in your component file and accessing the styles via the `$style` property:
78
+
```html
79
+
<stylemodule>
80
+
/* Will only be applied to this component <a> elements */
81
+
.red {
82
+
color: red;
83
+
}
84
+
</style>
85
+
86
+
<template>
87
+
<div:class="$style.red">Red Text</div>
88
+
</template>
89
+
90
+
<script>
91
+
exportdefault {
92
+
created() {
93
+
console.log(this.$style.red);
94
+
}
95
+
}
96
+
</script>
97
+
```
98
+
99
+
Note: composing from other files is not supported by the built-in CSS modules processor. See the community packages.
100
+
75
101
### Language packages
76
102
77
103
Using the power of preprocessors, you can use a different language (like less or jade) by adding a `lang` attribute on your `<template>`, `<script>` or `<style>` tags.
@@ -91,6 +117,9 @@ Official packages for `<style>` tag:
Community packages welcomed (add a your package with a PR)!
120
+
Community packages for `<style>` tag:
121
+
122
+
-[nathantreid:vue-css-modules](https://github.com/nathantreid/vue-css-modules) enables interop with nathantreid:css-modules, including support for composing from other files.
0 commit comments