Design comparison
Solution retrospective
Is there a better way using SASS to get the theme colors? I used standard CSS variables
Community feedback
- Account deleted
You should restrict the entry of multiple periods(.....), other than that everything works fine.
Marked as helpful1@dportillo23Posted over 3 years ago@thulanigamtee Thank you for the feedback :) you are right I didn't think about it.
0 - Account deleted
to get theme color using sass you can make file call _variables and put colors on file as a variables to make variable in sass $varName: value; and import the file in your main sass file and use the variables
notice: the underline before file to tell to sass compiler dont turn this to css file because you will import it on your main sass file
Marked as helpful0@dportillo23Posted over 3 years ago@Abdulrahman-M-Darwish Thank you very much for your replay, when I import _variables to the main scss it becomes a css and after that the colors are static, not dynamic (as in css variables) so when I change the themes, the colors don't change.
Probably I'm not understanding very well what you told me. Sorry, I'm still a bit unexperienced with SASS
0Account deleted@dportillo23 you mustn't change the CSS file because sass compiler always remove CSS changes you wrote you should change the theme from sass file to be dynamic not from CSS file
0@dportillo23Posted over 3 years ago@Abdulrahman-M-Darwish Thank you for your feedback and explanation :)
0
Please log in to post a comment
Log in with GitHubJoin our Discord community
Join thousands of Frontend Mentor community members taking the challenges, sharing resources, helping each other, and chatting about all things front-end!
Join our Discord