@askrjs/themes
v0.0.4
Published
Default theme tokens, styles, and themed layout wrappers for Askr apps.
Downloads
339
Maintainers
Readme
@askrjs/themes
CSS tokens, shell chrome, and styled composition helpers for Askr apps.
@askrjs/themes is the visual companion to @askrjs/ui and
@askrjs/charts. It owns the default theme, shared layout wrappers, and
theme-aware component styling while behavior and data contracts stay in the
other packages.
Install
npm install @askrjs/themes @askrjs/uiQuick Start
Import the default theme CSS in your app stylesheet:
@import "@askrjs/themes/default";Add the optional cat preset layer after the default theme when you want the curated preset family:
@import "@askrjs/themes/default";
@import "@askrjs/themes/presets";Then set data-theme to tabby, ginger, tuxedo, calico, or torty.
For picker/toggle composition, import CAT_THEME_OPTIONS and CAT_THEME_NAMES
from @askrjs/themes/theme.
Then use the theme helpers and curated component surfaces:
import { ThemeProvider, ThemeToggle } from "@askrjs/themes/theme";
import { Button, ButtonGroup, Field, InputGroup } from "@askrjs/themes/controls";
export function AppShell() {
return (
<ThemeProvider>
<ButtonGroup>
<Button variant="primary">Save</Button>
<ThemeToggle>{({ nextTheme }) => nextTheme}</ThemeToggle>
</ButtonGroup>
<Field>
<InputGroup>
<input />
</InputGroup>
</Field>
</ThemeProvider>
);
}What To Import
@askrjs/themes/themeforThemeProvider,ThemePicker,ThemeToggle, anduseTheme@askrjs/themes/controlsfor theme-styled controls such asButton,ButtonGroup,Close,Field, andInputGroup@askrjs/themes/layouts,@askrjs/themes/shells,@askrjs/themes/navs,@askrjs/themes/surfaces,@askrjs/themes/feedback, and@askrjs/themes/overlaysfor the curated visual composition surfaces
Theme Contract
Style public
data-*hooks and token variables, not internal DOM structure.Prefer token overrides before component overrides.
Keep selectors low specificity so downstream apps can customize them cleanly.
Use THEMING.md and docs/architecture.md for the full contract and package boundaries.
Use
visual-check.htmlfor manual QA across light and dark modes.
