Skip to content

This example demonstrates how to implement Theme Selector for the DevExtreme Project Template.

License

Notifications You must be signed in to change notification settings

dxArtemiusz/devextreme-project-template-theme-selector

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

38 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Selector for DevExtreme - How to implement Theme Selector for the DevExtreme Project Template

The DevExtreme Project Template has two default themes: base and swatch. You can change the base theme to another Material theme at runtime. To switch between themes, use the StyleSheet API. For this, disable all loaded theme stylesheet links excluding the active one.

The DevExtreme Project Template has several places where the SCSS variables used to change the color. To have the same color as main theme we use CSS variables and change them.

This sample demonstrates how to do this via a drop-down editor (SelectBox) located in a header (Toolbar). The default Project Template also has several elements that don't apply theme CSS rules (font color, background color) automatically. For these elements, you can use our predefined CSS classes:

To generate swatch themes you can use ThemeBuilder CLI:

npx devextreme-cli build-theme --base-theme="material.blue.light" --output-file="theme.additional.light" --make-swatch --assetsBasePath="../../../node_modules/devextreme/dist/css" --output-color-scheme="additional"

npx devextreme-cli build-theme --base-theme="material.blue.dark" --output-file="theme.additional.dark" --make-swatch --assetsBasePath="../../../node_modules/devextreme/dist/css" --output-color-scheme="additional"
Selector for DevExtreme - How to implement Theme Selector for the DevExtreme Project Template

Files to Review

Documentation

About

This example demonstrates how to implement Theme Selector for the DevExtreme Project Template.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • CSS 99.0%
  • Other 1.0%