Adding a Theme using JavaScript and Custom CSS

Опубликовано: 07 Октябрь 2024
на канале: AppShed
458
5

This short tutorial shows you how to apply a CSS theme to your app at the click of a button.
The CustomCSS field contains the code for the theme, and using a JavaScript action your app users can apply the theme. This could be expanded to allow them to choose a theme according to their preference.


The JavaScript code used in this video is:

Add Theme:

document.getElementsByClassName("app-navigator")[0].classList.add("theme1")

Remove Theme

document.getElementsByClassName("app-navigator")[0].classList.remove("theme1")