Styling Aurora UIX in a Host Application

Copy Markdown

Aurora UIX renders all of its generated components against a set of --auix-* CSS custom properties. This guide shows how to align those properties with your host application's design system — either by remapping them through a style bridge file or by overriding individual tokens directly — without touching any library source.

The five files and their cascade layers

Running mix auix.gen.stylesheet writes the following files and declares the layer order auix.baseline → auix.variables → auix.bridge → auix.rules:

File@layerOwnerPurpose
auix-baseline.cssauix.baselineHostTag-selector reset (html, body, a) using --auix-* variables. Opt-in for non-Tailwind hosts only — generate with mix auix.gen.stylesheet --baseline. Tailwind hosts already ship a preflight and must NOT import this file.
auix-variables.cssauix.variablesLibrary:root / :host declarations for every --auix-* custom property
auix-bridge-*.css (e.g. auix-bridge-daisyui.css)auix.bridgeHostMaps host design-system tokens onto --auix-* variables
auix-custom.cssauix.bridgeHostToken-level overrides that sit in the same layer as the bridge (opt-in; see below)
auix-rules.cssauix.rulesLibrary.auix-* component rules that consume the custom properties

The library regenerates auix-variables.css and auix-rules.css on every mix auix.gen.stylesheet run. The bridge, custom, and baseline files are host-owned: the task copies or creates them on first run (each behind its own opt-in flag where applicable) and skips them on subsequent runs unless --force is passed.

Choosing an integration path

Variables + rules only. Import auix-variables.css and auix-rules.css directly (or the auix-stylesheet.css shim). The components render using Aurora UIX's built-in defaults with no host-theme integration. This is the fastest path to a working UI.

Non-Tailwind hosts: add auix-baseline.css. Plain CSS apps, vanilla Phoenix apps, and Web Component hosts have no preflight to normalise html, body, and a. Generate the opt-in baseline stylesheet with mix auix.gen.stylesheet --baseline, then import it before auix-variables.css. Tailwind v4 hosts already ship a preflight and must skip this file — see Hosts without Tailwind below.

Bridge. Add the daisyUI bridge (auix-bridge-daisyui.css) or write your own. The bridge maps your framework's semantic tokens onto --auix-* variables so every component follows theme changes (dark mode, brand tokens, etc.) automatically. See Writing a Style Bridge for authoring guidance.

Recommended: style bridge + auix-custom.css. For hosts that already use a style bridge but need a few additional per-project tweaks, an auix-custom.css file provides a safe override layer that sits at the same cascade level as the style bridge. Token overrides written here take effect without modifying either library file. Run mix auix.gen.stylesheet --custom to scaffold the stub on first use.

Escape hatch: semantic class overrides. When a desired visual change cannot be expressed with a token override (e.g. restructuring flex layout), you can override .auix-* class rules directly. This is intentionally last-resort; see Escape hatch: semantic class overrides.

Import order

@import "auix-variables.css";
@import "auix-bridge-daisyui.css";  /* or your custom bridge */
@import "auix-custom.css";          /* host customizations (opt-in via --custom) */
@import "auix-rules.css";

Scaffolding auix-custom.css

Run the following to create the stub on first use:

mix auix.gen.stylesheet --custom

The file is treated as host-owned and will not be overwritten on subsequent runs. Pass --force together with --custom to regenerate it from the current theme defaults:

mix auix.gen.stylesheet --custom --force

Without --custom, the task never creates this file, so hosts that do not need it stay clean.

Wrapping pattern

All overrides must live inside @layer auix.bridge to win over auix.variables but lose to auix.rules (which provides the final component rules):

@layer auix.bridge {
  :root, :host {
    --auix-border-radius-default: 0.75rem;
    --auix-color-focus-ring: #7C3AED; /* violet-600 */
  }
}

Worked example: rounder corners + custom focus color

/* assets/css/auix-custom.css */
@layer auix.bridge {
  :root, :host {
    /* Round all component borders */
    --auix-border-radius-default: 0.75rem;
    --auix-border-radius-small:   0.375rem;
    --auix-border-radius-large:   1.25rem;

    /* Use a violet focus ring instead of the default indigo */
    --auix-color-focus-ring: #7C3AED;
  }
}

Both changes take effect for every generated form, table, and modal without modifying any library file.

Hosts without Tailwind

Tailwind v4 ships a preflight that resets html, body, a, and form elements. Plain CSS apps, vanilla Phoenix apps, and Web Component hosts have no such reset — without one, links render with browser-default purple+underline, body gets its default margin, and html loses the --auix-* font stack.

Scaffolding auix-baseline.css

auix-baseline.css is opt-in. Run:

mix auix.gen.stylesheet --baseline

The file is host-owned. Subsequent runs without --force leave it untouched. Pass --force together with --baseline to regenerate it from the current theme defaults:

mix auix.gen.stylesheet --baseline --force

Import order

Add one extra import before auix-variables.css:

@import "auix-baseline.css"; /* non-Tailwind hosts only */
@import "auix-variables.css";
@import "auix-bridge-daisyui.css";  /* or your custom bridge */
@import "auix-custom.css";          /* host customizations (opt-in via --custom) */
@import "auix-rules.css";

The reset uses the same --auix-* variables a bridge maps, so a style bridge still controls colours and typography — the baseline and style bridge complement each other. The reset sits in @layer auix.baseline, the lowest layer in the cascade, so both the style bridge and any rules-level overrides win over it.

Tailwind hosts: do not pass --baseline and do not import this file. Tailwind's preflight already normalises the same selectors, and double-resetting can produce subtle border and spacing regressions.

Variable reference

Sizes & dimensions

VariableDefaultAffects
--auix-box-size-unit1remCheckbox / icon base square size
--auix-line-height-default1.250remDefault line height
--auix-line-height-relaxed1.5remRelaxed/spacious line height
--auix-border-radius-default0.5remMost component corners
--auix-border-radius-small0.250remInputs, buttons, small badges
--auix-border-radius-large1remModals and large containers
--auix-border-radius-round9999pxPill / fully-rounded badges
--auix-border-width-default0.0625remStandard border width
--auix-border-width-thick0.125remActive tab underline
--auix-border-style-defaultsolidBorder style across all components
--auix-gap-minimal0.125remTightest flex gap
--auix-gap-default0.250remStandard flex gap
--auix-gap-medium0.500remMedium flex gap
--auix-gap-large0.750remLarge flex gap
--auix-padding-minimal0.3125remMinimal padding (inputs, buttons)
--auix-padding-small0.250remSmall padding
--auix-padding-default0.625remStandard padding
--auix-padding-medium0.500remMedium padding
--auix-padding-large1.5remLarge padding (cards)
--auix-padding-xl2remExtra-large padding (modal boxes)
--auix-margin-default0.250remStandard margin
--auix-margin-medium0.500remMedium margin
--auix-input-height-default1remMinimum input field height
--auix-button-height-default2emMinimum button height
--auix-hidden-element-size1pxVisually-hidden element dimensions
--auix-focus-outline-width2pxFocus outline width
--auix-icon-size-base0.25remBase unit for icon size calculations
--auix-icon-size-buttonvar(--auix-icon-size-4)Icon size inside buttons
--auix-breakpoint-sm640pxSmall breakpoint
--auix-breakpoint-md768pxMedium breakpoint
--auix-breakpoint-lg1024pxLarge breakpoint
--auix-breakpoint-xl1280pxExtra-large breakpoint
--auix-breakpoint-xxl1536pxDouble-XL breakpoint

Typography

VariableDefaultAffects
--auix-font-sansui-sans-serif, system-ui, sans-serif, …Sans-serif font stack
--auix-font-monoui-monospace, SFMono-Regular, Menlo, …Monospace font stack
--auix-font-family-defaultvar(--auix-font-sans)Default font family for all components
--auix-font-size-title1.125remSection and page titles
--auix-font-size-subtitle1remSubtitles and secondary headings
--auix-font-size-caption0.875remLabels, inputs, table cells
--auix-font-size-small0.750remBadges and helper text
--auix-font-weight-bold600Primary bold weight
--auix-font-weight-bold-semi400Secondary / semi-bold weight
--auix-font-style-mobile-viewmodeitalicView-mode field value style on mobile

Opacity

VariableDefaultAffects
--auix-opacity-200.20Close-button default opacity
--auix-opacity-400.40Close-button hover opacity
--auix-opacity-750.75Loading / disabled button opacity
--auix-opacity-1001Full opacity (disabled checkbox text)

Shadows & rings

VariableDefaultAffects
--auix-ring-inset(empty)Inset modifier for ring shadows
--auix-ring-offset-shadow0 0 #0000Ring offset transparent base
--auix-ring-offset-width0pxRing offset width
--auix-ring-colorrgba(63, 63, 70, 0.1)Default ring color (white_charcoal light)
--auix-ring-default0 0 0 calc(1px + …) var(--auix-ring-color)Default focus ring
--auix-ring-info0 0 0 calc(1px + …) var(--auix-color-info-ring)Info flash ring
--auix-ring-secondary0 0 0 calc(1px + …) var(--auix-color-shadow-alpha)Secondary ring
--auix-shadow-small0 1px 2px 0 …Subtle card / input shadow
--auix-shadow-default0 1px 3px 0 …, 0 1px 2px -1px …Default component shadow
--auix-shadow-md0 4px 6px -1px …, 0 2px 4px -2px …Medium shadow (error flash)
--auix-shadow-lg0 10px 15px -3px …, 0 4px 6px -4px …Large shadow (modal, info flash)
--auix-shadow-primaryvar(--auix-shadow-lg)Primary shadow alias
--auix-shadow-secondary0 4px 6px -1px var(--auix-color-shadow-alpha), …Colored secondary shadow

Colors

Colors are theme-dependent. The defaults shown here are from the white_charcoal theme in light mode (the library default). Dark-mode variants are applied automatically via --dark--auix-* intermediate variables when the host sets up a dark-mode selector.

Backgrounds

VariableDefault (light)Affects
--auix-color-bg-default#FFFFFFPrimary component background
--auix-color-bg-default--reverted#18181BInverted background (button fill)
--auix-color-bg-secondary#D4D4D8Secondary / alternating row background
--auix-color-bg-disabled#A1A1AADisabled element background
--auix-color-bg-info#F0FDF4Info flash background
--auix-color-bg-light#F4F4F5Light tinted background (groups, tabs)
--auix-color-bg-hover#FAFAFAHover state background
--auix-color-bg-hover--reverted#47474aHover on inverted elements
--auix-color-bg-backdroprgba(250,250,250,0.9)Modal / overlay backdrop
--auix-color-bg-inner-containerrgba(250,250,250,0.8)Embedded container background
--auix-color-bg-danger#FB7185Danger/destructive background
--auix-color-bg-danger-hover#E11D48Danger hover background
--auix-color-error-bg#FFF1F2Error flash / message background

Text

VariableDefault (light)Affects
--auix-color-text-primary#18181BMain body text
--auix-color-text-secondary#52525BSecondary / subdued text
--auix-color-text-tertiary#71717ATertiary / muted text
--auix-color-text-inactive#A1A1AADisabled / inactive text
--auix-color-text-label#27272AField labels and headings
--auix-color-text-hover#47474aText on hover states
--auix-color-text-on-accent#FFFFFFText on dark/accent backgrounds
--auix-color-text-on-accent-activergba(255,255,255,0.8)Active state text on accent
--auix-color-error-text#831843Error flash text
--auix-color-error-text-default#E11D48Inline validation error text
--auix-color-info-text#065F46Info flash text

Borders & Focus

VariableDefault (light)Affects
--auix-color-border-primary#D4D4D8Standard borders
--auix-color-border-secondary#E4E4E7Secondary borders
--auix-color-border-tertiary#F4F4F5Tertiary / hairline borders
--auix-color-border-focus#A1A1AAInput focus border color
--auix-color-focus-ring#6366F1Focus ring color (indigo-500)
--auix-color-error-ring#F43F5EError focus ring
--auix-color-info-ring#10B981Info focus ring
--auix-color-error#FB7185Input border on validation error

Icons

VariableDefault (light)Affects
--auix-color-icon-default#18181BDefault icon color
--auix-color-icon-fill#164E63Info icon fill
--auix-color-icon-safe#047857Safe/confirm action icons
--auix-color-icon-info#1D4ED8Informational action icons
--auix-color-icon-danger#BE123CDestructive action icons
--auix-color-icon-inactive#D4D4D8Inactive / low-relevance icons

Shadows (color tokens)

VariableDefault (light)Affects
--auix-color-shadow-black-alphargba(0,0,0,0.1)Default shadow darkness
--auix-color-shadow-black-alpha-smallrgba(0,0,0,0.05)Small shadow darkness
--auix-color-shadow-alphargba(71,71,74,0.1)Colored secondary shadow

Component aliases (derived from primitives above)

VariableDefaultAffects
--auix-color-button-bgvar(--auix-color-bg-default--reverted)Primary button fill
--auix-color-button-textvar(--auix-color-text-on-accent)Primary button text
--auix-color-button-alt-bgvar(--auix-color-bg-light)Alternative button fill
--auix-color-button-alt-textvar(--auix-color-text-tertiary)Alternative button text
--auix-color-button-alt-bordervar(--auix-color-text-label)Alternative button border
--auix-color-button-iconized-bg-hovervar(--auix-color-bg-hover)Icon-only button hover fill
--auix-color-input-textvar(--auix-color-text-primary)Input / textarea text
--auix-color-input-bordervar(--auix-color-border-primary)Input border
--auix-color-input-border-focusvar(--auix-color-border-focus)Input focus border
--auix-color-input-border-errorvar(--auix-color-error)Input error border
--auix-color-textarea-textvar(--auix-color-text-primary)Textarea text
--auix-color-textarea-bordervar(--auix-color-border-primary)Textarea border
--auix-color-textarea-border-focusvar(--auix-color-border-focus)Textarea focus border
--auix-color-textarea-border-errorvar(--auix-color-error)Textarea error border
--auix-color-select-bordervar(--auix-color-border-primary)Select border
--auix-color-select-border-focusvar(--auix-color-border-focus)Select focus border
--auix-color-checkbox-bordervar(--auix-color-border-primary)Checkbox border
--auix-color-checkbox-textvar(--auix-color-text-primary)Checkbox checkmark color
--auix-color-checkbox-label-textvar(--auix-color-text-secondary)Checkbox label text
--auix-color-label-textvar(--auix-color-text-label)Generic field label text
--auix-color-horizontal-dividervar(--auix-color-border-primary)Horizontal rule color
--auix-color-flash-close-textvar(--auix-color-text-secondary)Flash close-button icon
--auix-color-form-container-bgvar(--auix-color-bg-default)Form container background
--auix-color-group-container-bgvar(--auix-color-bg-light)Group/card container background
--auix-color-group-container-bordervar(--auix-color-border-primary)Group/card container border
--auix-color-show-content-bgvar(--auix-color-bg-default)Show-view content background
--auix-color-header-title-textvar(--auix-color-text-label)Page/section header title
--auix-color-header-subtitle-textvar(--auix-color-text-secondary)Page/section header subtitle
--auix-color-sections-tab-active-textvar(--auix-color-text-label)Active tab label
--auix-color-sections-tab-active-bgvar(--auix-color-bg-light)Active tab background
--auix-color-sections-tab-active-bordervar(--auix-color-bg-light)Active tab underline
--auix-color-sections-tab-inactive-bgvar(--auix-color-bg-hover)Inactive tab background
--auix-color-sections-content-bordervar(--auix-color-bg-light)Tab panel border
--auix-color-items-table-header-textvar(--auix-color-text-tertiary)Table column header text
--auix-color-items-table-body-bordervar(--auix-color-border-secondary)Table row separator
--auix-color-items-table-body-textvar(--auix-color-text-hover)Table cell text
--auix-color-items-table-row-bg-hovervar(--auix-color-bg-hover)Table row hover background
--auix-color-items-card-item-content-textvar(--auix-color-text-primary)Card item text
--auix-color-list-item-title-textvar(--auix-color-text-tertiary)List item title
--auix-color-list-item-content-textvar(--auix-color-text-hover)List item body text
--auix-color-list-container-dividervar(--auix-color-bg-light)List row separator
--auix-color-pagination-current-bgvar(--auix-color-bg-default--reverted)Current page button fill
--auix-color-pagination-current-textvar(--auix-color-text-on-accent)Current page button text
--auix-color-pagination-current-bordervar(--auix-color-border-focus)Current page button border
--auix-color-back-link-textvar(--auix-color-text-primary)Back-navigation link text
--auix-color-back-link-text-hovervar(--auix-color-text-hover)Back-navigation link hover text
--auix-color-embeds-bgvar(--auix-color-bg-inner-container)Embedded relation container background
--auix-color-embeds-bordervar(--auix-color-border-secondary)Embedded relation container border
--auix-color-embeds-many-badge-bgvar(--auix-color-bg-default--reverted)Embedded many badge fill
--auix-color-embeds-many-badge-textvar(--auix-color-text-on-accent)Embedded many badge text
--auix-color-one-to-many-textvar(--auix-color-text-primary)One-to-many relation text
--auix-color-one-to-many-bordervar(--auix-color-border-primary)One-to-many relation border
--auix-color-form-field-input-bordervar(--auix-color-border-primary)Form field input border
--auix-color-form-field-input-border-focusvar(--auix-color-focus-ring)Form field focus border
--auix-color-filter-input-bordervar(--auix-color-border-primary)Filter input border
--auix-color-filter-input-border-focusvar(--auix-color-focus-ring)Filter input focus border
--auix-color-filter-card-bordervar(--auix-color-border-primary)Filter card border

Recipe table

Common visual adjustments and the minimal set of variables to override:

GoalOverride
Denser forms--auix-padding-minimal, --auix-padding-default, --auix-gap-default
Rounder corners--auix-border-radius-default, --auix-border-radius-small, --auix-border-radius-large
Larger touch targets--auix-button-height-default, --auix-input-height-default, --auix-padding-default
Custom focus ring--auix-color-focus-ring, --auix-color-form-field-input-border-focus
Error palette--auix-color-error, --auix-color-error-bg, --auix-color-error-text, --auix-color-error-ring
Monospace inputs--auix-font-family-default set to var(--auix-font-mono)
Brand primary color--auix-color-button-bg, --auix-color-button-text, --auix-color-bg-default--reverted
Dark backgrounds--auix-color-bg-default, --auix-color-bg-light, --auix-color-bg-hover
Tighter list rows--auix-gap-minimal, --auix-padding-minimal, --auix-margin-default
Bolder labels--auix-font-weight-bold, --auix-color-text-label

Rule: one color class per element

An element may carry multiple CSS classes, but at most one of them may set color, background-color, or border-color. The classes ending in a BEM modifier (--alt, --errors, --iconized) and the named full-variant classes (.auix-index-all-action-button) are the color-bearing classes. Structural bases like .auix-button-default and size utilities like .auix-icon-size-5 are color-neutral and safe to combine freely with a color class.

When adding a brand variant, mirror the same pattern — declare a single class that sets color rules only (no padding, border-width, font-*, etc.) and let the component's structural base handle the rest:

/* ✅ Color-only variant — safe to layer on top of .auix-button-default */
.my-host-app .auix-button--promo {
  background-color: var(--my-brand-promo);
  color: var(--my-brand-promo-text);
}

Escape hatch: semantic class overrides

When a variable override cannot express the desired structural change — for example, switching a component's flex direction or inserting an additional layout layer — you can override the .auix-* class rules directly.

Warning: The class names listed below are a semi-public API. They may be renamed, split, or removed in any release without prior deprecation. Changes will be called out in CHANGELOG.md under a dedicated CSS class changes subsection. If you override these classes, you are accepting that responsibility. Prefer variable overrides whenever they can express the change.

Class reference

ClassUsed byTokens it consumes
.auix-button-defaultStructural base auto-applied to every <.button> (layout, border, padding, typography — no color)--auix-border-width-default, --auix-border-style-default, --auix-border-radius-small, --auix-padding-minimal, --auix-font-size-caption, --auix-font-weight-bold
.auix-buttonPrimary color variant (default for <.button> when no variant is passed)--auix-color-button-bg, --auix-color-button-text, --auix-color-bg-hover--reverted, --auix-color-text-on-accent-active, --auix-opacity-75
.auix-button--altSecondary / alternative button (caller-supplied via class=; sits on top of the auto-applied .auix-button-default — never combine with .auix-button)--auix-color-button-alt-bg, --auix-color-button-alt-text, --auix-color-button-alt-border, --auix-color-bg-hover, --auix-color-text-inactive
.auix-index-all-action-buttonSelect-all / deselect-all index-bar variant — color only; replaces, not supplements, .auix-button--auix-color-button-bg, --auix-color-button-text
.auix-button--iconizedIcon-only button (no border)--auix-color-bg-secondary (hover)
.auix-button-badgeEmbedded-relation count badge--auix-font-size-small, --auix-border-radius-round, --auix-padding-minimal
.auix-inputText / number / date inputs--auix-padding-minimal, --auix-border-width-default, --auix-border-style-default, --auix-border-radius-small, --auix-color-input-text, --auix-font-size-caption
.auix-input--errorsInput in validation-error state--auix-color-input-border-error
.auix-textareaMulti-line textarea--auix-padding-minimal, --auix-border-width-default, --auix-border-style-default, --auix-border-radius-small, --auix-color-textarea-text, --auix-font-size-caption
.auix-textarea--errorsTextarea in validation-error state--auix-color-textarea-border-error
.auix-selectDropdown select--auix-border-radius-small, --auix-border-width-default, --auix-color-select-border, --auix-color-bg-default, --auix-shadow-small, --auix-padding-minimal, --auix-padding-medium, --auix-box-size-unit
.auix-select-labelLabel paired with a selectStructural only
.auix-checkboxCheckbox input--auix-box-size-unit, --auix-margin-default, --auix-border-width-default, --auix-border-radius-small, --auix-color-checkbox-border, --auix-color-bg-default, --auix-color-checkbox-text, --auix-opacity-100
.auix-checkbox-labelLabel paired with a checkbox--auix-font-size-caption, --auix-color-checkbox-label-text
.auix-fieldsetForm fieldset wrapper--auix-gap-default, --auix-font-size-caption
.auix-modalModal root (hidden by default)Structural only
.auix-modal-boxModal positioning containerStructural only
.auix-modal-focus-wrapModal visible panel--auix-border-radius-large, --auix-color-bg-default, --auix-padding-xl, --auix-shadow-lg, --auix-shadow-secondary, --auix-ring-offset-shadow, --auix-ring-secondary, --auix-border-width-default
.auix-modal-close-buttonModal close (×) button--auix-border-width-default, --auix-border-radius-small, --auix-opacity-20, --auix-opacity-40
.auix-flashFlash notification container--auix-margin-default, --auix-gap-minimal, --auix-border-radius-default, --auix-padding-default
.auix-flash--infoInfo-variant flash--auix-color-bg-info, --auix-color-info-text, --auix-color-icon-fill, --auix-ring-info, --auix-shadow-primary
.auix-flash--errorError-variant flash--auix-color-error-bg, --auix-color-error-text, --auix-color-error-ring, --auix-shadow-md
.auix-flash-titleFlash notification title row--auix-font-size-caption, --auix-font-weight-bold
.auix-flash-messageFlash notification body text--auix-font-size-caption
.auix-simple-form-contentForm fields wrapper--auix-gap-default
.auix-simple-form-actionsForm submit/cancel button row--auix-gap-default
.auix-actionsGeneric action bar--auix-gap-default
.auix-horizontal-dividerHorizontal rule separator--auix-border-width-default, --auix-color-horizontal-divider, --auix-margin-default
.auix-sections-tab-buttonSection/tab navigation button--auix-padding-minimal, --auix-padding-default, --auix-font-size-caption, --auix-border-width-thick, --auix-border-radius-default

Scoping example

Scope overrides to a specific host section to avoid leaking into unrelated components:

/* Overrides the primary color variant only; sibling variants (.auix-button--alt,
   .auix-index-all-action-button) are unaffected and need their own override if
   matching brand color is desired there. */
.my-host-app .auix-button {
  background-color: var(--my-brand);
}

Verifying your overrides

  • Inspect computed values. Open DevTools → Elements → Computed and search for --auix- to see the resolved values in context.
  • Confirm layer precedence. In Chrome DevTools Styles pane, each rule shows its @layer. Check that your override is in auix.bridge and is not crossed out by a higher-specificity rule in auix.rules.
  • Visual smoke-test. Navigate to a generated index, form, or show page in the dev server and verify the change is visible across components.
  • For non-Tailwind hosts: confirm auix-baseline.css is imported by checking for @layer auix.baseline rules in the DevTools Styles pane on <html> or <body>. If absent, link styling will fall back to browser defaults; if you never generated the file, re-run mix auix.gen.stylesheet --baseline.