Skip to main content
Version: v1 (Current)

Theme customization recipes

Import @gxp-dev/app-ui/styles first, followed by your application stylesheet. The host's unlayered CSS can override AppUI's layered utilities/base rules. Scoped Vue SFC rules are also included in the complete style entrypoints.

Rounded brand theme​

.brand.gxp-theme {
--page_background_color: #f8fafc;
--page_text_color: #172033;
--primary_button_background_color: #1746b0;
--primary_button_text_color: #fff;
--primary_button_border_color: #1746b0;
--secondary_button_background_color: #e2e8f0;
--secondary_button_text_color: #172033;
--secondary_button_border_color: #94a3b8;
--input_field_background_color: #fff;
--input_field_text_color: #334155;
--input_field_border_color: #94a3b8;
--modal_background_color: #fff;
--modal_text_color: #172033;
--radius: 1rem;
--setting-primary_button_shape: 1rem;
--setting-secondary_button_shape: 1rem;
--setting-heading_1_font_family: 'Your Brand Font', system-ui, sans-serif;
--setting-paragraph_1_font_family: system-ui, sans-serif;
}
<ThemeWrapper class="brand"><YourApp /></ThemeWrapper>

Reactive theme switch​

<script setup lang="ts">
import { computed, ref } from 'vue'
import { ThemeWrapper, Button } from '@gxp-dev/app-ui'
const light = ref(false)
const colors = computed(() => light.value
? { page_background_color: '#fff', page_text_color: '#172033' }
: { page_background_color: '#101827', page_text_color: '#f8fafc' })
</script>
<template>
<ThemeWrapper :colors="colors">
<Button @click="light = !light">Switch theme</Button>
</ThemeWrapper>
</template>

This example changes the page surface/text only. Use a complete palette for inputs, cards, overlays and buttons when switching between light and dark modes. The built-in gxp-theme--light class supplies those additional values.

Component-level customization​

Use a class prop for spacing/layout and exposed props for component behavior. Use named slots for richer content, without copying the implementation. For example:

<CollectionGrid :items="items" @select="selectItem">
<template #item="{ item }">
<h2 class="text-lg font-semibold">{{ item.title }}</h2>
<p class="text-sm">{{ item.description }}</p>
</template>
</CollectionGrid>

The card's built-in action remains available. The generated reference lists the actual slots/events for each component.

Verify a theme in Storybook using the Platform/Light toolbar switch, then test your full app at mobile and kiosk sizes. Check input text, focus outlines, disabled controls, error messages, overlay content and portal placement. Theming overview.