Skip to main content

Detail page: a per-route theme

This entire page: header, footer, and content uses the Rijkshuisstijl Community theme instead of this project's default start-theme. The rest of the site keeps its own theme, so this page lives in its own route group, app/(detail)/, with its own root layout, app/(detail)/layout.tsx, that applies the rhc-theme class and imports @rijkshuisstijl-community/design-tokens instead.

How to change themes

A theme is just a design tokens package plus a class name. To use a different one:

  1. Install the design tokens package for the theme you want.

    pnpm add @rijkshuisstijl-community/design-tokens
  2. Import its CSS once, wherever you apply the theme.

    import '@rijkshuisstijl-community/design-tokens/dist/index.css';
  3. Apply the theme's class name to whichever element should carry it. For a single, global theme, that's the <html> element in app/layout.tsx.

Every theme documents its own class name and token package — check the theme's README instead of assuming rhc-theme or start-theme apply universally.

How to add custom CSS variables

Most components have defined their own custom tokens. So you can easily overwrite them to create your own theme. For this page several CSS variables have been overwritten. Have a look in /app/(detail)/detail/detail.css.