Override variables.css


#1

Hello,

I’m trying to do the fellowing thing for a while now but I keep failing. I want to implement a theme option inside my applications and need to overwrite the variables.css so I can change the primary color and possible also some other colors.
I know sass is a preprocessor so it is processed before all the rest.
But in the worst case the app need to reload itself complete to enable the changes (if there is a way to do this automatic that would be awsome!).
In the best case the application does it on the run and instant.
Is there a way to do it?

Thanks is advance for the help of the more experiences programmers here (I just started learning ionic 3 some weeks ago.)

Greetings,
Nyffellare


#2

Not really sure what you are asking, but here goes.

Changing primary colors happens in the /src/theme/variables.scss

Here is a list of variables you can change.


#3

Sorry for the misunderstanding, english isn’t my native language.
I know that where you can change them. But I want to find a way to change them during runtime of the app. I have a page called settings and there can the user chose his theme. If he choses pink the primary color has to become pink. If he choses red the primary color needs to change to red.

My thought was that he rewrite the variable.scss file and restart the app so it can process the new color. But a perfect situation would be that he rerite the primary color value and reprocesses the app without having to restart the whole application.