# Theme > AstrolUi offers a vibrant color palette for .Net Blazor, where each color represents a unique theme. It allows for 100% customization, enabling you to personalize the themes according to your preferences. Source page: https://doc.astrolui.com/theme Theme color and light/dark mode. Changes apply right away, without reloading the page. ## 1. Theme color Pick a color: the docs change right away (same as the circles in the top bar) and it is remembered next time. ## 2. Mode Automatic follows the operating system preference and changes live when the user changes it. ## 3. Design tokens AstrolUI exposes its visual system as CSS variables with the **--aui-** prefix. They change by themselves with the theme color (**data-aui-color**) and the mode (**data-aui-mode**), so your own CSS stays consistent without extra work. - **Surfaces:** --aui-bg (page background), --aui-surface (cards, fields), --aui-surface-2 (headers, footers), --aui-surface-hover. - **Text:** --aui-text, --aui-text-2 (secondary), --aui-text-3 (hints, quiet icons); --aui-link. - **Borders:** --aui-border, --aui-border-strong. - **Brand:** --aui-brand, --aui-brand-strong, --aui-on-brand (text on the brand), --aui-brand-soft (tint), --aui-brand-text (text on the tint), --aui-brand-ring and --aui-focus-ring (focus). - **States:** --aui-danger, --aui-success, --aui-warning, --aui-info. - **Shape and motion:** --aui-radius-sm / --aui-radius / --aui-radius-lg / --aui-radius-pill (6 / 8 / 12 / 999 px), --aui-h-control (38 px), --aui-shadow-sm / --aui-shadow / --aui-shadow-lg, --aui-dur, --aui-ease. - **Typography:** --aui-font, --aui-font-mono, --aui-text-xs / sm / md / lg / xl (12 / 13 / 14 / 16 / 20 px). The old variables (--color-base, --background, --layout-*...) still exist as aliases of these tokens so existing CSS keeps working. ```css /* Use the tokens in your own CSS: they follow the theme color and light/dark mode */ .my-card { background: var(--aui-surface); border: 1px solid var(--aui-border); border-radius: var(--aui-radius-lg); box-shadow: var(--aui-shadow-sm); color: var(--aui-text); } .my-card small { color: var(--aui-text-2); } .my-card .highlight { background: var(--aui-brand-soft); color: var(--aui-brand-text); } .my-card .action { background: var(--aui-brand); color: var(--aui-on-brand); } /* Your own brand color: override it in a theme */ [data-aui-color="blue"] { --aui-brand: #0057b8; --aui-brand-strong: #003f86; --aui-on-brand: #fff; } ``` ## 4. Change the theme in your app **AstrolLayoutMenu** applies the color (**Style**) and the mode (**Mode**). Change those variables and the layout repaints without reloading; with **AstrolThemeSwitcher** the user does it from the top bar. Save the preference wherever you want (localStorage, user profile...). ```razor ... @code { private AstrolTheme theme = AstrolTheme.Yellow; private AstrolThemeMode mode = AstrolThemeMode.Auto; } ``` ## 5. Your own theme Besides the six colors, AstrolUI accepts any brand color. Every component of every package (buttons, forms, table, menu, charts, board, editor, PDF viewer...) is painted with three variables: **--aui-brand**, **--aui-brand-strong** and **--aui-on-brand**; soft shades, the focus ring and the rest derive from them. With **data-aui-color="custom"** those variables come from **--aui-custom-brand** (and optionally **--aui-custom-brand-strong** and **--aui-custom-on-brand**). **AstrolCustomTheme** (Astrol.Entities.Basic) computes all three from a single color: the strong shade and the text color (white or dark) with the most contrast. AstrolThemeSwitcher is not required: the color can come from settings, the database (one color per customer) or a color field. Pick a color here to apply it to the whole documentation. ```razor @* 1. With AstrolLayoutMenu: Style = Custom + CustomColor (also applied to ) *@ ... @* 2. On any container (or ), without the layout *@
@* buttons, grid, toggles, charts... use the color *@
@* 3. For the whole app from C# (e.g. the color of each customer, read from the database) *@ ``` ```css /* CSS only: one variable is enough (the strong shade and the text color have defaults) */ :root { --aui-custom-brand: #0ea5e9; } /* Or a named theme of your own: data-aui-color="acme" */ [data-aui-color="acme"] { --aui-brand: #0f766e; /* buttons, focus, selection, active menu item */ --aui-brand-strong: #115e59; /* hover and text over light backgrounds */ --aui-on-brand: #ffffff; /* text on top of the color */ } ```