How to override component CSS variables
There are two strategies for customizing a BEEQ component’s styles:Global override
Set CSS custom properties on the component element selector to apply changes across all instances of a component in your theme.
Targeted override
Use CSS classes or specific component selectors to customize individual instances without affecting others.
Global override
Set CSS custom properties directly on the component selector. This applies the customization to all instances of that component across your entire application.Targeted override
Create a custom CSS class and apply it to specific component instances. This gives fine-grained control without affecting other instances.Example: customizing the Badge component
The Badge component exposes the following CSS custom properties (seebq-badge.variables.scss):
Global override
Applies the custom styles to everybq-badge in the application.
Targeted override
Only thebq-badge elements with the matching CSS class will have the overridden style.
Best practices
DoPrefer declarative color variables (
--bq-background--primary) over primitive values (--bq-grey-100) in your custom themes for better consistency and automatic light/dark mode switching.Don’tDo not hardcode raw hex values (e.g.
#ffffff, #1f2937) in component overrides — they will not adapt to theme or mode changes automatically.DoUse CSS classes or component selectors to scope component overrides to specific instances and avoid unintended side effects elsewhere in the app.
Don’tDo not apply a global component override (e.g.
bq-badge { ... }) unless you intentionally want it to affect every instance across the entire application.DoAlways test your component overrides in both light and dark modes to verify proper contrast, readability, and visual consistency.
Don’tDo not skip contrast validation. WCAG 2.1 Level AA requires a 4.5:1 ratio for normal text and 3:1 for large text — overriding colors without checking can fail these requirements.
DoUse the primitive color palette as the source for custom theme colors. It includes blue, coral, cyan, gold, green, indigo, iris, lime, magenta, orange, purple, red, sky, teal, volcano, and yellow — each with 10 shades (100–1000).
Don’tDo not invent arbitrary color values outside the palette. Random hex colors break visual harmony and make future theme maintenance much harder.