Change bootstrap theme at runtime

Is this possible ?

Cheers

Steve Warby

Not easily. Each theme has its own set of css files. AppStudio makes sure the correct ones are loaded with your project. If you want to download additional sets, you will be on your own.

With dark mode becoming more popular, would it be possible to have AS handle two themes, like darkly vs flatly. One for light mode and one for dark mode.

I think you will need to do something like the following in project css to fully control the color of each element. This switches automatically between modes where the os/browser supports dark mode. However, the AS designer does not reflect the scheme(s):

:root {
–color-bg: white;
–color-txt-light: black;
}

@media (prefers-color-scheme: light) {
:root {
–color-bg: white;
–color-txt: black;
}
}

@media (prefers-color-scheme: dark) {
:root {
–color-bg: black;
–color-txt: lightgrey;
}
}

Then:

.inputLabel {
background-color: var(–color-bg);
color: var(–color-txt);
}

@GaryGorsline - this is a new issue. Could you open a new topic for it?

@silvercoder - there’s stuff built into AppStudio 8 for this. Check out the sample - more docs are coming.