Theming
Registry items are built to be themed in two layers:
- Built-in item defaults, defined with Tailwind utility classes and variants.
- Item-level overrides, applied through
classNameprops, slot className props, and local variant edits.
This keeps a consistent design language across items while still allowing targeted adjustments where teams need them.
How Registry Item Theming Works
Section titled “How Registry Item Theming Works”Most registry items are authored with Tailwind class utilities and lightweight variant systems (for example, cva variants like primary, secondary, outline).
In practice, the registry keeps:
- Defaults that are already styled and usable out of the box.
- Shared components with stable props (
variant,kind,className, slot-level class names) for theming without rewriting item internals. - Blocks that compose themed components, so foundational style changes (for example Button or Link variants) cascade consistently.
This follows the same philosophy as the rest of the registry: sensible defaults first, with explicit extension points available when teams need flexibility.
Tailwind In This Registry
Section titled “Tailwind In This Registry”Tailwind is used as the primary styling layer for registry items:
- Layout, spacing, typography, and state styles are expressed as utility classes.
- Dark mode support is handled with Tailwind
dark:utilities where needed. - Utility composition is centralized with
cn(...)and, for variants,class-variance-authority.
Registry items currently lean on explicit Tailwind palette utilities (primarily Slate/Zinc with dark: variants) for their defaults.
Color System: Tailwind + Shortened Radix Scale
Section titled “Color System: Tailwind + Shortened Radix Scale”The color approach is based on Radix accessibility principles, shortened for practical implementation and mapped into a Tailwind-first workflow.
Tailwind color families provide 11 shade steps (50 through 950) (Tailwind colors). The registry intentionally uses a curated 9-step subset from Tailwind Slate and Zinc, mapped to Radix intent categories (Radix Colors) so contrast behavior stays predictable across surfaces, interaction states, borders, solids, and text.
Usage intent by scale step:
- Steps 1-2: Background surfaces
- Steps 3 and 5: Interactive states (hover/active)
- Step 8: Borders and separators
- Steps 9-10: Solid fills
- Steps 11-12: Accessible text
In this registry, those intents are expressed through Tailwind Slate/Zinc families and variant conventions, with 9 selected shades aligned to Radix steps.
Registry Folder Focus
Section titled “Registry Folder Focus”This page focuses on styling registry items under:
src/registry/rokkit200-ui/componentssrc/registry/rokkit200-ui/blocks
These items are the source of truth for installable UI. Theme changes are supported through each item’s exposed className/variant APIs and through direct edits to installed item styles.
Component-level overrides
Section titled “Component-level overrides”Per-item class overrides provide local adjustments without rewriting item internals.
Many blocks/components expose slot className props such as:
classNameheadingClassNamebodyClassNamelinksClassNamemediaClassName
Example:
<HeroOne heading="Build faster" mainBody={body} links={links} media={media} className="rounded-3xl border border-slate-300 bg-slate-50" headingClassName="text-6xl tracking-tight text-slate-900" bodyClassName="text-lg text-slate-700" linksClassName="gap-3"/>For primitives with variants (for example Button/Link), variant props and className work together for fine-tuning.
<Button variant="primary" className="bg-emerald-600 hover:bg-emerald-700"> Continue</Button>When a use-case requires deeper visual change, installed registry item variant classes can be edited directly (for example buttonVariants in a local copy).
Dark mode
Section titled “Dark mode”Dark mode is supported using Tailwind dark: utilities in registry item classes:
dark:classes handle component-level differences between light and dark treatments.
Dark mode support is implemented with contrast and readability as first priorities, followed by brand expression. Strong brand palettes still benefit from contrast checks across both surface and accent backgrounds.
Working with existing styles
Section titled “Working with existing styles”When integrating into an existing Optimizely project, the registry keeps customization points explicit:
- Each item’s variant and className APIs act as primary extension points.
- Shared overrides can live close to installed registry item files, keeping behavior easy to trace.
- Per-item
classNameprops support contextual differences. - Registry-level consistency comes from shared variants and reusable block/component patterns, even when projects add local overrides.
This approach keeps theming maintainable as more registry items are added over time.