Answer the question
In order to leave comments, you need to log in
Different site color templates?
Hello. Website in vuejs + css. I'm slowly rewriting in sass.
The site has 2 themes while, dark are planned more.
Now it’s done like this: a theme class is placed on the body and then the styles go like this:
.nav {
position: absolute;
left: 0;
top: 0;
background: #fff;
}
.dark .nav {
background: #1b2f41;
}
Answer the question
In order to leave comments, you need to log in
Helped to become prgssr.ru/development/temizaciya-s-sass-beskonechn...
Chose the 1st approach.
Video tutorial that can help you - https://www.youtube.com/watch?v=H4cG4tbc-xQ&t=1390s
Article that can help you - https://webdesign-master.ru/blog/tools/2016- 06-04-...
Documentation in Russian - https://sass-scss.ru
You can make variables in sass. They can be changed. Due to this, you can manage themes, since all components will depend on them.
Looking ahead - use localstorage to store the theme in it. Otherwise, after the reboot, the topic will fly off.
Sass'u like json can be fed. Those. make some themes.json
{
'default': {
'textColor': '#000',
'bgColor': '#f5f5f5'
},
'dark': {
'textColor': '#f5f5f5',
'bgColor': '#212121'
} // и т.д.
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question