Skip to content
Esc
↑↓navigate↵open⌘Jpreview
On this page

Theme Astro components with your brand

Choose a complete Gnostic or shadcn preset for Astro. Set component styles, colors, fonts, and radius, then use the same design for preview and installation.

gnosticai UI follows the same CSS variable and semantic token model as shadcn/ui.

Where to make changes

Generated sites use src/styles/tailwind.css for Tailwind imports, token mappings, and base rules. It imports theme.css, which holds colors, fonts, and radius. Keep the @theme inline mappings in tailwind.css so utilities such as bg-background, text-foreground, and border-border use the same semantic tokens.

Installed Astro components and CVA definitions contain the selected preset’s Tailwind classes. They work without a preset loader. Available presets are Default, Glow, Soft, Graphite, Vega, Nova, Maia, Lyra, Mira, Luma, Sera, and Rhea. Choose the preset before installation. To change component rules later, edit or reinstall the component source. Components and blocks do not have a local preset prop. Colors, fonts, and radius remain CSS tokens.

Glow, Soft, and Graphite include shared spacing, fonts, surfaces, and control rules. They are complete styles in the same list as Vega. Colors, font overrides, and radius are separate preset choices. Style default preserves the existing fonts.

Use the theme generator to compare styles, choose a palette, and export CSS or theme JSON. A template supplies page structure separately. The page also gives you a shadcn init --preset <url> command for the complete Astro preset. Gnostic options use URLs because shadcn short codes cannot record custom style names such as Glow, Soft, and Graphite.

Installed preset CSS

Choose the preset on the theme generator, then use its setup command before adding components. The CLI merges the selected tokens into the Tailwind file configured in components.json. Component source contains the selected Tailwind classes. Both work without a browser preset loader.

Use one component preset for the project. Portfolio and Nimbus are template names; their default component presets are Glow and Soft. Generated sites put selected tokens in src/styles/theme.css and import that file through tailwind.css. Keep the document’s data-preset attribute from setup. Changing a token stylesheet does not replace installed component classes.

Caller utilities merge after component utilities. Match the recipe’s responsive variants when you override a value, for example h-12 sm:h-12.

Text and headings

Use semantic HTML for text. The heading level describes the document structure; its class sets the visual size. Typography components are no longer supplied.

Install prose styles with bunx --bun shadcn@latest add @gnostic/typeset. Import src/styles/typeset.css after Tailwind in the stylesheet that loads your project styles. Blocks that render prose import this file themselves.

<article class="typeset">
  <h2>A section in an article</h2>
  <p>Body text stays at the chosen base size.</p>
</article>

Typeset uses three controls: --typeset-size (default 1rem), --typeset-leading (1.75), and --typeset-flow (1.25em). Set the base size in rem or px. Heading bounds are multiples of that base size, and heading spacing follows the flow value. The container controls heading growth; body text does not change at viewport breakpoints. Use not-typeset to exclude a region. Components with data-slot keep their own styles.

For hero, page, and section titles, use text-hero, text-page-title, or text-section-title. The shared setup supplies these utilities. Put @container/heading on the text column, with a width supplied by its layout. In a split hero, this is the column beside the image. A heading cannot use itself as its size container.

<div class="@container/heading w-full min-w-0 max-w-xl">
  <h1 class="text-hero font-heading font-semibold tracking-tight text-balance">
    A title that fits its column
  </h1>
  <p class="mt-6 text-base leading-relaxed">Supporting copy.</p>
</div>

The title utilities use clamp() with cqi and a 1rem base outside Typeset. Set --typeset-size on the text container to change that base. A block can also set numeric --heading-min and --heading-max values on a title to change its bounds. For example, class="text-hero [--heading-max:3]" caps it at three times the base size. Keep shared type rules in the UI package and block-specific width, spacing, and heading ranges with the block.

Tokens to keep in sync

Most projects only need four starting colors: background, card, primary, and secondary. The generator derives the other semantic colors and writes OKLCH values. The selected style sets the --radius token and component rules. The Default palette uses the shared theme.css directly, with all its tokens.

Dark mode

If you use the included ThemeToggle, render ThemeProvider in your document <head> so the saved theme or system preference is applied before the page paints.

For deeper token guidance, use the official shadcn/ui theming docs and dark mode docs as the reference.

Font files

Fonts use Astro’s built-in font API. Gnostic uses Satoshi from Fontshare. Soft uses Google Sans. Glow uses Satoshi for text and buttons. Nimbus blocks also use Abel for condensed text. Shadcn font choices use Fontsource.

The preset registry and site generator supply src/lib/fonts.ts. Connect its fonts export to the Astro config, then render PresetFonts in the layout head as shown in Installation. Astro serves the downloaded files from the site. No Framer font assets or browser CDN stylesheet is needed.

A CSS export changes tokens only. It does not install font files. If you change the selected fonts, update the Astro font config as well. The site generator does this for new sites. theme apply updates an existing, unedited generated font config. If that config has local edits, merge the font changes yourself.

Docs register the preview font choices without preloading them. The browser loads a font when the docs or an example uses it. The docs body and headings use the selected preset fonts.

Satoshi uses 450 as its normal weight. Google Sans and explicit shadcn font choices use 400. The preset sets Tailwind’s --font-weight-normal token, so font-normal follows this choice. Use font-medium for 500 or font-[400] for an explicit 400. Buttons inherit the text font; there is no button font token.