简体   繁体   中英

How to pass variables to SCSS from a Django View

I have a simple problem, but cannot find the literature to find a solution for. I would like to let the user choose night mode, day mode, vibrant mode, etc. on my Django website. For that to work, I need to pass that variable to my SCSS file. How do I go about that? How can I pass a variable from the Django view to a SCSS file? I have looked at this answer , but this does not show it by an example and is not about SCSS files. I'd appreciate if you could provide a short example with your answer as well as the relevant documentation page.

To works with "skins" mode, you must create your css theme files, and rather than pass scss variables you must pass which file your website must import, like

if user choose nightmode, import nightmode.css

if user choose lightmode, import lightmode.css

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM