# @ibti-tech/tokens

> Design tokens for the IBTI Design System — colors, spacing, typography, and generated CSS variables / Tailwind theme.

Latest version **0.5.0** (published 2026-11-19) · MIT license · 0 weekly downloads

## Install

```sh
npm install @ibti-tech/tokens
pnpm add @ibti-tech/tokens
yarn add @ibti-tech/tokens
bun add @ibti-tech/tokens
```

## Health

**Score 70/100 (B)** — status: active.

Positive: has types; esm support; no vulnerabilities; recently updated; high maintenance score; high quality score.

Warnings: low downloads; pre 1.0.

## Facts

| | |
|---|---|
| Version | 0.5.0 |
| Published | 2026-11-19 |
| First published | 2023-09-12 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 82 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | IBTI IT Solutions |
| Maintainers | ibtitech |
| Keywords | ibti, ibti-tech, design-tokens, design-system, css-variables, tailwindcss, theme, typescript |

## Links

- npm: https://www.npmjs.com/package/@ibti-tech/tokens
- Repository: https://github.com/ibti-solutions/ibti-design-system
- Homepage: https://ds.ibti.tech
- Issues: https://github.com/ibti-solutions/ibti-design-system/issues
- npm.io page: https://npm.io/package/@ibti-tech/tokens

## Alternatives

- [@openai/codex-sdk](https://npm.io/package/@openai/codex-sdk.md) — 731.4K weekly downloads
- [babel-plugin-transform-react-jsx](https://npm.io/package/babel-plugin-transform-react-jsx.md) — 565.0K weekly downloads
- [babel-helper-remove-or-void](https://npm.io/package/babel-helper-remove-or-void.md) — 508.5K weekly downloads
- [@pnpm/store-controller-types](https://npm.io/package/@pnpm/store-controller-types.md) — 186.9K weekly downloads
- [react-native-signature-canvas](https://npm.io/package/react-native-signature-canvas.md) — 155.6K weekly downloads

## Recent versions

- 0.5.0 (latest) — 2026-11-19
- 0.4.0 — 2023-12-13
- 0.3.0 — 2023-11-29
- 0.2.5 — 2023-11-23
- 0.2.4 — 2023-11-08
- 0.2.3 — 2023-11-07
- 0.2.2 — 2023-10-31
- 0.2.1 — 2023-10-30
- 0.2.0 — 2023-10-30
- 0.1.0 — 2023-10-19
- 0.0.0 — 2023-09-12

## README

# `@ibti-tech/tokens`

Design tokens for the IBTI design system, shipped as TypeScript objects and as a CSS file (CSS variables + Tailwind CSS v4 `@theme`).

## Install

```bash
pnpm add @ibti-tech/tokens
```

## TypeScript

```ts
import {
  colors,
  spacing,
  boxShadow,
  transition,
  breakpoints,
} from '@ibti-tech/tokens'

colors.semantic.action.default // '#F47C46'
spacing.components.medium // '1rem'
boxShadow.focusRing
transition.duration.fast // '.15s'
transition.easing.standard
```

| Export                                                                 | Contents                                                                                              |
| ---------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- |
| `colors`                                                               | `primary`, `error`, `success`, `warning` palettes + `semantic`                                        |
| `semanticThemes`, `themeLayers`                                        | Raw light/dark values for theme-aware semantic colors and legacy `layer-*` / `content-*` HSL channels |
| `spacing`                                                              | `components` and `sections` scales                                                                    |
| `borderRadius`, `font`, `blurRadius`, `fieldSizes`, `zIndex`, `layout` | Misc scales                                                                                           |
| `boxShadow`                                                            | `normal/medium/large` (legacy), `sm/md/lg/xl`, `focusRing`                                            |
| `transition`                                                           | `fast/default/slow` (legacy), `duration.*`, `easing.*`                                                |
| `breakpoints`, `screens`, `validBreakpointNames`                       | Responsiveness                                                                                        |

### Semantic colors

```ts
colors.semantic = {
  action:    { default, hover, active, subtle, contrast },
  highlight: { default, subtle, strong },
  surface:   { default, muted, elevated },          // theme-aware (CSS vars)
  content:   { primary, secondary, muted, inverse }, // theme-aware (CSS vars)
  border:    { default, strong, focus },
  focus:     { ring },
}
```

`surface`, `content` and `border.default/strong` are `var(--ibti-*)` references, so they only resolve when `@ibti-tech/tokens/css` is loaded. `action`, `highlight`, `focus` and `border.focus` are plain hex values.

### Spacing scale and aliases

Canonical keys are `smaller | small | medium | large | larger`. For migration, `xsmall` (= `smaller`) and `xlarge` (= `larger`) are also available in both `components` and `sections`. They are deprecated and will be removed in a future major.

### Responsiveness

`breakpoints`, `screens` and `validBreakpointNames` are exported from `src/responsiveness.ts`. The old misspelled `src/reponsiveness.ts` is kept and re-exported for compatibility, but is no longer imported by the index.

## CSS

```css
/* plain CSS variables */
@import '@ibti-tech/tokens/css';
/* or */
@import '@ibti-tech/tokens/tokens.css';
```

With Tailwind CSS v4:

```css
@import 'tailwindcss';
@import '@ibti-tech/tokens/css';
```

`dist/tokens.css` contains:

- `:root` — all tokens as CSS variables (`--color-primary-normal`, `--spacing-component-small`, `--radius-medium`, `--font-size-large`, `--shadow-md`, `--breakpoint-tablet`, `--transition-duration-fast`, `--z-index-modals`, ...).
- `@theme { ... }` — Tailwind v4 static tokens (`--color-*`, `--spacing-*`, `--radius-*`, `--font-size-*`, `--shadow-*`, `--breakpoint-*`, `--ease-*`).
- `@theme inline { ... }` — theme-aware semantic colors (`--color-surface-*`, `--color-content-*`, `--color-border-*`) that point at `--ibti-*` variables, so utilities such as `bg-surface-default` follow the active theme.
- `[data-theme='light']` (also the `:root` default) and `[data-theme='dark']` — `--ibti-surface-*`, `--ibti-content-*`, `--ibti-border-*`, plus the legacy HSL-channel `--color-layer-*` and `--color-content-*` variables used by `@ibti-tech/ui`.

Set `data-theme="light" | "dark"` on the `<html>` element to switch themes.

## Development

```bash
pnpm build         # tsup, then generate dist/tokens.css
pnpm generate:css  # only regenerate dist/tokens.css
pnpm test
pnpm typecheck
```

`scripts/generate-css.mjs` runs without a TypeScript build and reads `scripts/token-data.mjs`, a plain-JS mirror of the values in `src/`. When you change a token in `src/`, update `token-data.mjs` too; `test/token-data.test.mjs` fails if they drift.

`build` runs `tsup` first because `tsup` cleans `dist/`; the CSS generator creates `dist/` itself if it is missing.

---
_Source: https://npm.io/package/@ibti-tech/tokens · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
