@tsuki/tokens (0.2.1)
Published 2026-06-14 09:37:52 +00:00 by dev
Installation
@tsuki:registry=https://git.d-v.cc/api/packages/tsuki/npm/npm install @tsuki/tokens@0.2.1"@tsuki/tokens": "0.2.1"About this package
Design tokens for the tsuki design system
@tsuki/tokens
Design tokens for the tsuki design system. Authored in CSS, distributed as CSS, JSON (W3C DTCG), JavaScript (with types), TOML, and a Tailwind v4 @theme mapping.
Install
# .npmrc
@tsuki:registry=https://git.d-v.cc/api/packages/tsuki/npm/
//git.d-v.cc/api/packages/tsuki/npm/:_authToken=${GITEA_NPM_READ_TOKEN}
pnpm add @tsuki/tokens
Use
/* CSS — raw custom properties */
@import '@tsuki/fonts/css'; /* MUST come before tokens; declares @font-face */
@import '@tsuki/tokens/css';
.button { background: var(--shu-500); color: var(--accent-fg); }
/* Tailwind v4 — adds bg-shu-500 etc. utilities */
@import 'tailwindcss';
@import '@tsuki/tokens/theme';
// JavaScript — typed access to the same values
import { shu, kami, sumi } from '@tsuki/tokens';
console.log(shu['500']); // '#9B3C30'
// W3C Design Tokens (DTCG)
import tokens from '@tsuki/tokens/json' assert { type: 'json' };
Develop
pnpm install
pnpm build # emits dist/
pnpm test # runs build tests
The source of truth is src/tokens.css. Everything in dist/ is generated by src/build.ts.
Releasing
# One-time on your machine — token needs package:write scope.
export GITEA_NPM_TOKEN=<your-gitea-personal-access-token>
# Cut a release:
pnpm install
pnpm test
pnpm build
npm version <patch|minor|major> # bumps package.json + git tag
npm publish # honors publishConfig.registry
git push --follow-tags
The repo's .npmrc reads GITEA_NPM_TOKEN from the environment — never commit the token. The publishConfig.registry in package.json pins the publish target so a stray npm publish can't hit npmjs.org.
Dependencies
Development Dependencies
| ID | Version |
|---|---|
| tsx | ^4.19.0 |
| typescript | ^5.6.0 |
| vitest | ^2.1.0 |
Details
2026-06-14 09:37:52 +00:00
Assets (1)
Versions (3)
View all
npm
84
latest
10 KiB
tokens-0.2.1.tgz
10 KiB