Explore related sections: Colors, Global CSS Variables, and Customization.
Applying themes
BEEQ lets you apply themes using either HTML attributes (recommended) or CSS classes, ensuring a consistent look for every application.Using HTML attributes
Set thebq-theme attribute on the <html> element (recommended) or the <body> tag.
Using CSS classes
Alternatively, apply themes using CSS classes directly on the root element.When applying a theme, maintain consistency and avoid mixing different themes throughout the app.
Applying modes
Modes let you switch between light and dark color schemes to match user preferences or specific app needs. You can control modes globally or for specific sections using HTML attributes or CSS classes.Using HTML attributes
Set thebq-mode attribute to control the color scheme.
Using CSS classes
Combining modes
You can mix and match modes at various levels of your layout. For instance, you might use dark mode for the main section of your app and switch to light mode for a nested component.User’s color scheme preferences
BEEQ does not automatically detect or apply the user’s preferred color scheme. It is up to you to control whether users see light or dark mode in your app. To provide a better experience:- Make the
prefers-color-schemesetting your default. - Allow users to switch this option in your app.
- Remember their choice and apply it when they log in or return to the app.
prefers-color-scheme media query is not used by BEEQ automatically, as not all applications support dark mode, which might cause problems for those that don’t.
Example
Here is a working example showing how to read the user’s preferred color scheme on load and let them toggle it using abq-switch.
Next steps
Custom Theme
Follow the step-by-step guide to create and apply a fully custom theme to your app.
Global CSS Variables
Explore the color tokens and base variables that power BEEQ themes and modes.