1👍
I believe you mean global CSS variables and yes you can but be mindful of browser support. If you’re using a pre-processor like SCSS, you can define and share variables too.
CSS Variables
:root {
--color: red;
}
and your Vue component style block:
<style>
.some-class {
color: var(--color);
}
</style>
An example with SCSS
SCSS Variables in a file for example: /assets/vars.scss
$color: red;
and your Vue component style block:
<style lang="scss">
@import "~/assets/vars.scss";
.some-class {
color: $color;
}
</style>
- [Vuejs]-How to embed html/js widgets in Nuxt, specifically iFlyChat but broadly applicable
- [Vuejs]-Vuex state is sometimes empty (undefined), especially when I refresh the page and sometimes it works
Source:stackexchange.com