Dynamically change CSS in Mobile/Reactive

Hi,


I want to change the CSS at runtime in Mobile/Reactive. I already implement something with javascript like this post. But I'm at a stage where I need to change more than just the color of the theme.

My goal is to implement something similar to this


Thank you,

Cátia

Hmmm if you are going to generate the css on runtime you might as well use variables so you can use the same css but just change around the variables using user input.

https://www.w3schools.com/css/css3_variables.asp

You could set some session variables on login perhaps?

Joey Moree wrote:

Hmmm if you are going to generate the css on runtime you might as well use variables so you can use the same css but just change around the variables using user input.

https://www.w3schools.com/css/css3_variables.asp

You could set some session variables on login perhaps?

but I want a way to add a style sheet just like the action AddStyleSheetTag but for Mobile/Reactive. 

It's something to keep in the session. 


Hi Catia,


Stylesheets can be replaced at runtime using javascript

var findlink = document.getElementsById("myLinkId");
findlink.href = "stylesheetxhtml.css";


Hope this helps.


Regards,

Saugat

Joey Moree escreveu:

Hmmm, se você deseja gerar o css no tempo de execução, você também pode usar variáveis para poder usar o mesmo css, mas apenas mudar as variáveis usando a entrada do usuário.

https://www.w3schools.com/css/css3_variables.asp

Você pode definir algumas variáveis de sessão no login, talvez?



Joey Moree, ele deseja alterar / criar uma folha de estilos em tempo de execução e não criar variáveis css.

Joey Moree wrote:

Hmmm if you are going to generate the css on runtime you might as well use variables so you can use the same css but just change around the variables using user input.

https://www.w3schools.com/css/css3_variables.asp

You could set some session variables on login perhaps?

 
Joey Moree,

 he wants to change / create a style sheet at runtime and not create css variables.


Saugat Biswas wrote:

Hi Catia,


Stylesheets can be replaced at runtime using javascript

var findlink = document.getElementsById("myLinkId");
findlink.href = "stylesheetxhtml.css";


Hope this helps.


Regards,

Saugat

Saugat Biswas, 

he wants to change / create a style sheet at run time and not change the style sheet to an existing one.

Try to imagine users saving theme customizations to the database as primary color and etc. And then a style sheet is created by customizing the theme color according to the company / user profile