I understand how to use the color themes in my html, but looking at the example located here:
https://framework7.io/docs/color-themes.html#helper-classes
How can I dynamically change themes (color themes [red, yellow, blue, etc] and layout themes [light or dark] during the app running like the sample shows?
Got it working by using javascript to add/remove a class on button click.
Excuse me, can you show the code please? I am experiencing the same thing
The code should also be in the Kitchen Sink example as well, but generally speaking, you can add a class to body
for example using JavaScript or simply using Dom7
:
$$ = Dom7;
$$('body').addClass('theme-dark color-theme-pink'); // Dark pink theme
Is it placed on the index.html ? or other?
This is JavaScript; you can place it in your HTML file inside a <script></script>
tag, or your own .js
file, where you, for example, initialize F7, etc.