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
Is it possible to change the theme (colors) in real time on a running site?
The zodiase-mdl.json file has the default theme colors, I would like to have the MDL color selection wheel on my site (or similar) and then allow a user pick their own color theme.
Thanks
The text was updated successfully, but these errors were encountered:
Well... Let's look at it this way: you want different users to see different themes, which means there has to be a mechanism for generating the theme stylesheet on the fly, based on whatever criteria you want. In other words, you need something at the client side to request for a theme stylesheet after the user is logged in, and at server side a nodejs program to compose the stylesheet. To make theming easy, hopefully the nodejs program only needs to compose SASS code. But for the client to consume the stylesheet, the final data has to be CSS code. So somehow you have to use a SASS compiler to produce the final CSS code.
With all the above setup, you can configure theming variables in your dynamic SASS code then load the MDL theme SASS to produce CSS files with different MDL themes.
If you are only interested in the pre-built theme CSS files, use the undocumented hidden method _mdlGetAsset('dist/material.amber-cyan.min.css') on the server side to get the amber-cyan theme CSS file data. You still need some dynamic CSS loading on the client side and a server endpoint to serve the raw CSS data.
Is it possible to change the theme (colors) in real time on a running site?
The zodiase-mdl.json file has the default theme colors, I would like to have the MDL color selection wheel on my site (or similar) and then allow a user pick their own color theme.
Thanks
The text was updated successfully, but these errors were encountered: