CSS theming
AppUI themes use ordinary CSS custom properties containing complete CSS color values (#hex, rgb(), oklch(), etc.). No component rebuild or application Tailwind setup is required.
Load the styles once
import '@gxp-dev/app-ui/styles'
This includes generated utility classes, the platform-to-semantic bridge with fallback values, and all Vue SFC styles. styles/base currently supplies the same bridge and component rules; it does not strip the fallbacks. styles/themes/default.css is an optional explicit demo palette, used by Storybook. Hosted apps should inherit the platform palette instead of importing that demo palette.
style.css contains only extracted SFC styles. It is not a replacement for the complete style entrypoint.
Scope the theme to your app
<script setup lang="ts">
import { ThemeWrapper, Button, Dialog, DialogTrigger, DialogContent, DialogTitle, DialogDescription } from '@gxp-dev/app-ui'
const colors = {
page_background_color: '#f8fafc', page_text_color: '#172033',
input_field_background_color: '#ffffff', input_field_text_color: '#334155',
input_field_border_color: '#94a3b8',
primary_button_background_color: '#1746b0', primary_button_text_color: '#ffffff',
primary_button_border_color: '#1746b0',
secondary_button_background_color: '#e2e8f0', secondary_button_text_color: '#172033',
secondary_button_border_color: '#94a3b8',
modal_background_color: '#ffffff', modal_text_color: '#172033',
}
</script>
<template>
<ThemeWrapper :colors="colors" class="p-6">
<Dialog>
<DialogTrigger as-child><Button>Open preview</Button></DialogTrigger>
<DialogContent>
<DialogTitle>Theme preview</DialogTitle>
<DialogDescription>This overlay inherits the local app palette.</DialogDescription>
</DialogContent>
</Dialog>
</ThemeWrapper>
</template>
The wrapper sets variables on its own element and never writes to document.documentElement. Empty palette entries inherit their surrounding values. Additional keys support the platform's modal, keyboard, spinner, and typography settings. Use keys without -- in colors.
The .gxp-theme class re-declares the bridge on every scope: a variable computed only at :root would otherwise retain its ancestor's palette. Semantic overrides such as --card should also be set on the scope where they apply.
For plain CSS, place gxp-theme on your container:
.my-app.gxp-theme {
--page_background_color: #f8fafc;
--page_text_color: #172033;
--primary_button_background_color: #1746b0;
--primary_button_text_color: #fff;
--card: #fff;
--card-foreground: #172033;
--muted: #e2e8f0;
--muted-foreground: #475569;
--radius: 0.75rem;
}
For a ready-to-use light palette:
import '@gxp-dev/app-ui/styles'
import '@gxp-dev/app-ui/styles/themes/light.css'
<ThemeWrapper class="gxp-theme--light"><YourApp /></ThemeWrapper>
Overlay placement
Dialog, AlertDialog, Sheet, Popover, Select, Combobox, HoverCard, Tooltip, and auto-portaled menu surfaces obtain their portal target from the nearest ThemeWrapper. Without a wrapper they retain Reka UI's body target. Nest wrappers for independent themes.
Dialog, AlertDialog and Sheet also derive their surface/action tokens from the modal palette; use modal_primary_button_* and modal_secondary_button_* keys for independent modal buttons.
Every auto-portaled surface also accepts portalTo (CSS selector or element). Its target must exist and carry the intended CSS variables. A target under an ancestor with overflow: hidden, transforms, or containment can affect positioning/clipping, so choose the scope/container accordingly. An app that only uses a plain .gxp-theme div should pass portalTo explicitly for its overlays. Explicitly rendered DropdownMenuPortal / ContextMenuPortal accept Reka UI's to prop. Set disablePortal on their nested content component to avoid a second teleport. Auto-portaled surfaces also accept disablePortal for deliberate inline composition.
Typography, shapes, and kiosk behavior
heading-1, heading-2, paragraph-1, paragraph-2, and button text use the platform's --setting-*_font_family, --setting-*_font_weight, and --setting-*_font_style variables. Utility font sizes remain overridable with component class props or your own CSS. The style bundle includes the existing Lexend web-font import; set family variables to your own loaded fonts for branded/offline deployments.
--radius controls primitive rounding. Platform button classes use --setting-primary_button_shape, --setting-secondary_button_shape, and --setting-tertiary_button_shape; set both systems if you want matching shapes.
ThemeWrapper can render an optional logoImage (logoAlt supplies its accessible name) and its logo slot overrides that region. An explicit logoSize scopes --setting-logo_size; omitting it retains the host setting.
Regular apps retain native scrolling and selection. ThemeWrapper kiosk or .gxp-kiosk opts into disabled selection and touch panning while editable fields remain selectable. Touch-driven canvases have their own interaction rules. ExperienceFlow respects prefers-reduced-motion for transitions. The complete styles include animate.css for the optional directional animation settings, so those work in standalone apps as well as the host.
Canvas pens/backgrounds, generated media, QR colors and explicit visual props are content settings: supply those props when their colors should differ. CSS variables do not recolor previously exported images or videos. Keep QR codes high-contrast and preserve their quiet zone.
See the token reference and customization recipes.