@rokkit/themes
v1.2.0
Published
Theme styles for @rokkit/ui components
Downloads
3,385
Readme
@rokkit/themes
Pre-built CSS themes for @rokkit/ui components.
Install
npm install @rokkit/themes
# or
bun add @rokkit/themesOverview
@rokkit/themes provides visual styles for @rokkit/ui components. Components in @rokkit/ui are unstyled by default — themes layer on top without requiring changes to component markup. Styles target semantic data-* attributes that components emit (e.g. [data-button], [data-list-item]).
Available themes:
| Theme | Description |
| ---------- | -------------------------------------------------------------------- |
| rokkit | Default — gradients and glowing borders |
| minimal | Clean and subtle |
| material | Elevation and shadows |
| frosted | Frosted glass and blur |
| zen-sumi | Ink on paper — no shadows, no gradients |
| base | Structural styles only (layout and positioning, no visual treatment) |
Usage
Full bundle (base + all themes)
@import '@rokkit/themes';Or in JavaScript/TypeScript:
import '@rokkit/themes'Single theme
@import '@rokkit/themes/rokkit.css';
/* or */
@import '@rokkit/themes/minimal.css';
/* or */
@import '@rokkit/themes/material.css';
/* or */
@import '@rokkit/themes/frosted.css';
/* or */
@import '@rokkit/themes/zen-sumi.css';Base structural styles only
@import '@rokkit/themes/base';Useful when writing a fully custom theme — imports layout and positioning rules without any visual styling.
Individual component styles
@import '@rokkit/themes/base/button.css';
@import '@rokkit/themes/rokkit/button.css';Theme scoping
The rokkit theme is the default and applies without any wrapper element.
Other themes are scoped using the data-style attribute:
<!-- Apply minimal theme to a section -->
<div data-style="minimal">
<!-- @rokkit/ui components here use the minimal theme -->
</div>
<!-- Apply a theme globally -->
<html data-style="material"></html>Switching themes at runtime is a matter of updating the data-style attribute.
Custom themes
To build your own theme:
- Import
@rokkit/themes/basefor structural styles. - Write CSS targeting the same
data-*attribute selectors used by the built-in themes. - Scope your selectors with
[data-style='my-theme']to enable runtime switching.
Component attribute hooks follow the pattern [data-style='my-theme'] [data-button], [data-style='my-theme'] [data-list-item], etc.
Architecture
src/
base/ -- Structural styles (layout, spacing, positioning)
rokkit/ -- Default theme (gradients + borders)
minimal/ -- Clean + subtle theme
material/ -- Elevation + shadows theme
frosted/ -- Frosted glass + blur theme
zen-sumi/ -- Ink on paper theme (no shadows, no gradients)
index.css -- Full bundle entry pointPart of Rokkit — a Svelte 5 component library and design system.
