Theming
Components are styled at runtime from a preset, not from a stylesheet you import. That makes theming a matter of configuration. angulux ships one preset, Lux, and accepts the presets of the package Lux was derived from — which sit on the other side of a licence boundary worth understanding.
Where the styling comes from
provideAngulux({ theme: { preset } }) takes a preset and injects the resulting CSS at runtime. Nothing is compiled into your bundle at build time, which is why changing a preset is a configuration change rather than a rebuild of your styles.
The preset this site runs under is Lux, from @anguless/angulux-themes. It is derived from the Aura preset of @primeuix/themes 2.0.3 — PrimeTek's package, MIT at that version — and keeps every token name, so an override written for Aura applies to Lux unchanged. It changes two things: the colours that carry text, which the Contrast section below lists, and the shape. Corners are rounder (8px on a field or a button, where Aura has 6px), the focus ring is 2px wide instead of 1px, and a card is outlined instead of casting a shadow. Heights are the same as Aura's.
Lux Compact, from @anguless/angulux-themes/lux-compact, is Lux with less padding: a field is 4px shorter and a table row 8px shorter. It is meant for screens that are mostly tables and forms, and it is not the default because a control that short is small under a finger.
A practical consequence worth knowing early: a component that looks wrong on this site looks wrong in your application too, because this site styles its components exactly the way yours will. The chrome around them is the only thing written by hand here.
Customising a preset
definePreset takes an existing preset and overrides the tokens you name. Everything you do not name is inherited, so a brand colour is a few lines rather than a fork of a design system.
import { definePreset } from '@anguless/angulux-themes';import Lux from '@anguless/angulux-themes/lux';const Brand = definePreset(Lux, { semantic: { primary: { 50: '{indigo.50}', 500: '{indigo.500}', 900: '{indigo.900}' } }});provideAngulux({ theme: { preset: Brand } });Contrast
Lux meets WCAG AA for the text of every severity colour, in both schemes. That is the reason it exists. The preset it was derived from does not: while this site still ran under that preset, in November 2026, a sweep of every text node inside a demo, measured against the background actually painted behind it, found 76 failing nodes across 20 of the 51 modules that had demos. Put the same components on a card in dark mode and two more colours fall short: they are the last two rows below.
The table is what Lux changes. The left column is the upstream value, the right column is the value Lux carries. If you use Lux, you have the right column already, and the override further down is not for you.
| What fails | Scheme | Aura | Lux |
|---|---|---|---|
| primary fill | light | emerald.500 — 2.54:1 | emerald.700 — 5.48:1 |
| success fill | light | green.500 — 2.28:1 | green.700 — 5.02:1 |
| info fill | light | sky.500 — 2.77:1 | sky.700 — 5.93:1 |
| warn fill | light | orange.500 — 2.80:1 | orange.700 — 5.18:1 |
| danger fill | light | red.500 — 3.76:1 | red.600 — 4.83:1 |
| help fill | light | purple.500 — 3.96:1 | purple.600 — 5.38:1 |
| success message text | light | green.600 — 3.16:1 | green.700 — 4.80:1 |
| warn message text | light | yellow.600 — 2.85:1 | yellow.700 — 4.77:1 |
| error message text | light | red.600 — 4.43:1 | red.700 — 5.94:1 |
| toggle button label, off | light | surface.500 — 4.34:1 | surface.600 — 6.92:1 |
| info message text | dark | blue.500 — 3.96:1 | blue.400 — 5.73:1 |
| error message text | dark | red.500 — 3.98:1 | red.400 — 5.42:1 |
A fill row is white text on that colour, and the same ratio holds for an outlined or text button, which is that colour on white. The pattern behind the fills: each one is the -500 step of a palette, a step built for about 3:1 — the bar for a border or a large heading, not for a label. Note that one step darker is not enough for four of the six: at -600, green still measures 3.30 and sky 4.10. Only danger and help clear AA there.
If you stay on Aura, definePreset reaches all of these without forking anything. The override below produces the right-hand column on top of Aura. It is measured in a browser on every build of this library, next to Lux, and the two are required to give the same ratio for every text node: the code is cut out of the file that test runs, not typed onto this page.
import { definePreset } from '@primeuix/themes';import Aura from '@primeuix/themes/aura';// Solid fills: the step each palette needs before white text on it reaches 4.5:1,// with hover and active one and two steps further, so neither is lighter than rest.const fill = (palette: string, rest: number, hover: number, active: number) => ({ background: `{${palette}.${rest}}`, hoverBackground: `{${palette}.${hover}}`, activeBackground: `{${palette}.${active}}`, borderColor: `{${palette}.${rest}}`, hoverBorderColor: `{${palette}.${hover}}`, activeBorderColor: `{${palette}.${active}}`});// Coloured text on a white or tinted background.const ink = (color: string) => ({ color });const message = (color: string) => ({ color, outlined: { color }, simple: { color } });// Everything sits under colorScheme.light, except the last block. The dark scheme// reads the same palette steps as TEXT on a dark surface, so an override that is// not scoped to light makes dark mode worse.export const Accessible = definePreset(Aura, { semantic: { colorScheme: { light: { primary: { color: '{primary.700}', hoverColor: '{primary.800}', activeColor: '{primary.900}' } } } }, components: { button: { colorScheme: { light: { root: { success: fill('green', 700, 800, 900), info: fill('sky', 700, 800, 900), warn: fill('orange', 700, 800, 900), help: fill('purple', 600, 700, 800), danger: fill('red', 600, 700, 800) }, outlined: { success: ink('{green.700}'), info: ink('{sky.700}'), warn: ink('{orange.700}'), help: ink('{purple.600}'), danger: ink('{red.600}') }, text: { success: ink('{green.700}'), info: ink('{sky.700}'), warn: ink('{orange.700}'), help: ink('{purple.600}'), danger: ink('{red.600}') } } } }, badge: { colorScheme: { light: { success: { background: '{green.700}' }, info: { background: '{sky.700}' }, warn: { background: '{orange.700}' }, danger: { background: '{red.600}' } } } }, message: { colorScheme: { light: { success: message('{green.700}'), warn: message('{yellow.700}'), error: message('{red.700}') }, // Dark: only info and error fall short, and only over a card. dark: { info: message('{blue.400}'), error: message('{red.400}') } } }, toast: { colorScheme: { light: { success: ink('{green.700}'), warn: ink('{yellow.700}'), error: ink('{red.700}') }, dark: { info: ink('{blue.400}'), error: ink('{red.400}') } } }, togglebutton: { colorScheme: { light: { root: { color: '{surface.600}' }, icon: { color: '{surface.600}' } } } } }});provideAngulux({ theme: { preset: Accessible } });Keep it scoped to the light scheme. The shorter way is to darken the palette steps themselves, under primitive, and until November 2026 this page printed exactly that. It was wrong. A primitive has no colour scheme, and the dark scheme uses those same steps as text on a dark surface: measured over a card, that override took the dark success message from 5.92 to 3.05 and the dark error message from 3.98 to 3.26. It also left the light warning message at 2.85 and the toggle label at 4.34, because neither reads a step it changed. If you copied it, replace it with the one above.
What this costs you, in Lux and in the override alike, and what it does not cover. The primary colour in light mode is two steps darker than Aura's everywhere it is read, focus rings and checked boxes included. The tokens name palette steps, not ratios: if you swap the primary palette for a brand colour, step 700 of your palette is a different colour and has to be measured again. Anything that extends Aura rather than Lux starts from Aura's colours. And the measurement reads resting text only — hover, focus and disabled states are not in it, nor are icons.
Dark mode
The default is 'system': the operating system decides and nothing in your application overrides it. If you want a toggle, name a selector instead.
provideAngulux({ theme: { preset: Lux, options: { // Default is 'system' — the operating system decides and nothing you // write can override it. Name a selector to drive it yourself. darkModeSelector: '.dark' } }})Then put that class on the document — and put it there before the first paint. This is the part that is easy to get subtly wrong: a service that sets the class during bootstrap runs after the page has already been painted, so anyone on dark mode gets a white flash on every navigation. On a prerendered or server-rendered site that flash is the whole page.
// Decide the class BEFORE the first paint, in index.html <head>.// An Angular service cannot: by the time a bundle has run, the page is painted.(function () { try { var stored = localStorage.getItem('scheme'); var dark = stored ? stored === 'dark' : matchMedia('(prefers-color-scheme: dark)').matches; if (dark) document.documentElement.classList.add('dark'); } catch (e) { /* storage blocked: light is the correct fallback */ }})(); Use the same selector for both halves. If your own chrome follows a button while the components follow darkModeSelector: 'system', a reader who switches gets half a dark page. This site drives both from one .dark class for exactly that reason — the button in the header is the proof.
Running without a preset
Supported, and not a degraded mode by accident — it is what makes a preset package genuinely optional. Structure, behaviour, accessibility and the p-* class names are all still there; the colours are not.
// No preset package at all. provideAngulux() still works;// components render with structure and behaviour but no preset colours.provideAngulux()The licence boundary
Lux is MIT and is published by this project, so an application that uses it has no PrimeTek package to pin. This section is for the other case: you want Lara, Nora or Material, which angulux does not ship, or you are already on Aura and are staying there.
@primeuix/themes is MIT through 2.0.3, and 3.0.0 is the first commercial release. That release exists and is what the registry serves as latest, so the MIT line is closed rather than paused. angulux declares the package as an optional peer ranged ^2.0.0, and installing angulux alone pulls in zero PrimeTek packages.
Be clear about what that range buys you, though — it is a warning, not a lock. Installing a version above it still succeeds and only prints a resolution warning naming the range it broke. If the boundary matters to your legal review, pin it exactly and run a licence check in your own build rather than trusting ours.
# Only if you use a preset from the upstream package instead of Lux.# The range angulux declares is a WARNING, not a lock: installing 3.x# still succeeds and only prints a resolution warning. If the licence# boundary matters to your review, pin it and check it in your own build.pnpm add @primeuix/themes@2.0.3 --save-exactWhat this means in practice: that package will not receive new MIT releases, so with one of its presets you are choosing to sit on a version that is finished rather than one that is maintained. Lux is maintained here, and it is one preset, not four. That is a real cost either way, and it is the honest reason to read the migration page before adopting anything here — it names the alternatives, including the ones that are not angulux.