Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

@tomasnikl/theme

Design tokens and a tiny light/dark theme runtime powering tomasnikl.cz and my lab projects.

Install

npm i @tomasnikl/theme

Usage

CSS — one import brings fonts, colors, typography, spacing, motion and dark-mode overrides:

@import "@tomasnikl/theme/tokens.css";

Or cherry-pick: @import "@tomasnikl/theme/tokens/colors.css";

JS — theme switching with localStorage persistence:

import { getTheme, setTheme, toggleTheme, subscribeTheme } from "@tomasnikl/theme";

Dark mode contract

setTheme("dark") sets data-theme="dark" on <html>; token overrides in tokens/dark.css key off :root[data-theme="dark"]. State persists under the tn-theme localStorage key.

Tokens

Group File Examples
Colors tokens/colors.css --accent, --surface-card, --ink-700, --text-body
Dark mode tokens/dark.css --paper-0, --ink-900, --btn-primary-bg, --selection-bg
Typography tokens/typography.css --font-display, --text-h1, --weight-bold, --leading-normal
Spacing tokens/spacing.css --space-4, --radius-lg, --shadow-card, --container
Motion tokens/motion.css --ease-out, --dur-base, --reveal-rise
Fonts tokens/fonts.css loads Figtree and IBM Plex Mono via @import; no custom properties

License

MIT

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages