Skip to content
Open
Show file tree
Hide file tree
Changes from 77 commits
Commits
Show all changes
88 commits
Select commit Hold shift + click to select a range
d03f0ab
chore: 🤖 create design-tokens package placeholder's package.json
punkbit Mar 24, 2026
83d5374
docs: 📝 add initial README.md
punkbit Mar 24, 2026
ac13360
docs: 📝 add initial README.md
punkbit Mar 24, 2026
478e688
docs: 📝 add token SPECIFICATION.md
punkbit Mar 24, 2026
b2a071f
chore: 🤖 update yarn.lock
punkbit Mar 24, 2026
ce1c238
fix: 🐛 exports
punkbit Mar 24, 2026
e4fa2c0
chore: 🤖 add dictionary containing DTCG token files, e.g. primitives.…
punkbit Mar 24, 2026
c13c874
chore: 🤖 terrazzo dictionary to css builder
punkbit Mar 24, 2026
16805a8
chore: 🤖 add note
punkbit Mar 25, 2026
a185017
docs: 📝 distribution strategy
punkbit Mar 25, 2026
ff4cccd
docs: 📝 brief token spec in readme
punkbit Mar 25, 2026
babc91c
docs: 📝 lint rules
punkbit Mar 25, 2026
23057fb
fix: 🐛 remove leading 0
punkbit Mar 25, 2026
b8948df
fix: 🐛 packages require a build command
punkbit Mar 25, 2026
f42764a
fix: 🐛 typo
punkbit Mar 25, 2026
0dd57ee
fix: 🐛 typography missing in import order
punkbit Mar 25, 2026
8eb6cc9
fix: 🐛 typo
punkbit Mar 25, 2026
26249e5
chore: 🤖 remove TODO
punkbit Mar 25, 2026
5ec5d11
fix: 🐛 Tokens meant for CSS layout should use : "dimension" with stri…
punkbit Mar 25, 2026
7a9939f
chore: 🤖 lint/test placeholders
punkbit Mar 25, 2026
4bc0d7f
fix: 🐛 spacing description misplaced
punkbit Mar 25, 2026
24ff98d
fix: 🐛 removed the non-standard "style" condition.
punkbit Mar 25, 2026
611930d
fix: 🐛 remove empty icon block from token dictionary
punkbit Mar 25, 2026
4d0a7e4
fix: 🐛 both should say Secondary button …
punkbit Mar 25, 2026
80dcf97
fix: 🐛 table now accurately reflects the actual token paths used in …
punkbit Mar 25, 2026
0e50648
chore: 🤖 add changeset
punkbit Mar 25, 2026
2709b3d
chore: 🤖 update changeset to include instructions
punkbit Mar 25, 2026
a0830b4
fix: 🐛 Changed press to active for color.background.interactive.secon…
punkbit Mar 25, 2026
5225e12
fix: 🐛 Changed from {color.gray.805} to {color.gray.800} to match th…
punkbit Mar 25, 2026
4af5c4e
chore: 🤖 use tz check as linter
punkbit Mar 25, 2026
d81003d
refactor: 💡 created config.js with centralized settings
punkbit Mar 25, 2026
3a71d43
refactor: 💡 hex values consistency lowercase
punkbit Mar 25, 2026
97e2c11
chore: 🤖 add TODO
punkbit Mar 25, 2026
0b95c4c
chore: 🤖 add mode selector
punkbit Mar 25, 2026
8a8cec5
chore: 🤖 add format
punkbit Mar 25, 2026
37fa09f
fix: 🐛 no visual hover distinction in light mode for the primary button
punkbit Mar 25, 2026
8592f9a
fix: 🐛 border muted in dark mode
punkbit Mar 25, 2026
037d348
fix: 🐛 both secondary button states, now the ghost button has appropr…
punkbit Mar 25, 2026
49018e0
chore: 🤖 skip test
punkbit Mar 25, 2026
447e84e
fix: 🐛 inconsistent values
punkbit Mar 25, 2026
ae35caa
chore: 🤖 dark mode support via OS support
punkbit Mar 25, 2026
effa1dc
refactor: 💡 gray naming
punkbit Mar 26, 2026
fe1ff78
refactor: 💡 remove resolver, use mode
punkbit Mar 26, 2026
f02b1e7
refactor: 💡 gray vs neutral vs charcoal palettes
punkbit Mar 26, 2026
8466be5
refactor: 💡 Broken token reference (semantic.dtcg.json:74): color.bac…
punkbit Mar 26, 2026
e26e997
refactor: 💡 opacity tokens now live under neutral/opacity/{percent} w…
punkbit Mar 26, 2026
813f51e
refactor: 💡 gray descriptions colour refs
punkbit Mar 26, 2026
dc7824b
refactor: 💡 changed {color.gray.650} to {color.neutral.650} in semant…
punkbit Mar 26, 2026
6d07ae7
chore: 🤖 make terrazzo generate final css with legacy hex
punkbit Mar 26, 2026
e22526f
refactor: 💡 convert to compliant DTCG colour space
punkbit Mar 26, 2026
2c58bf1
chore: 🤖 clear dist before build
punkbit Mar 26, 2026
719a621
fix: 🐛 token themes light/dark mode handling
punkbit Mar 26, 2026
bbdb118
refactor: 💡 transform js into ts
punkbit Mar 27, 2026
2ec5e86
chore: 🤖 add formatter
punkbit Mar 27, 2026
7ab7264
style(tokens): 💄 transform tokens into solid colours
punkbit Mar 30, 2026
92c2e8f
style(tokens): 💄 primitives, moved semantic meaning to semantic layer
punkbit Mar 30, 2026
53c822d
style(tokens): 💄 All Semantic Names Removed from Primitives
punkbit Mar 30, 2026
9ec20a4
style(tokens): 💄 copy latest tokens from chore/monorepo-figma-design-…
punkbit Mar 30, 2026
a7d9ce2
chore: 🤖 update lockfile
punkbit Mar 31, 2026
20964ab
chore: 🤖 set access as public
punkbit Mar 31, 2026
523cd6f
fix: 🐛 remove duplicates
punkbit Mar 31, 2026
71ea689
chore: 🤖 re-enable colour lint
punkbit Mar 31, 2026
cc161b2
fix: 🐛 publishConfig
punkbit Mar 31, 2026
cec87d6
refactor: 💡 make radius semantic as t-shirt sizing
punkbit Mar 31, 2026
e2c9de7
refactor: 💡 separate primitives from theme semantic tokens
punkbit Mar 31, 2026
355cbbb
style(tokens): 💄 add semantic tokens for radius
punkbit Apr 1, 2026
997adb9
style(tokens): 💄 add semantic tokens for sizing
punkbit Apr 1, 2026
48dc1d1
style(tokens): 💄 add semantic tokens for spacing
punkbit Apr 1, 2026
4675276
fix: 🐛 token naming
punkbit Apr 1, 2026
6638e83
chore: 🤖 remove backup
punkbit Apr 1, 2026
65ba032
docs: 📝 update specification
punkbit Apr 2, 2026
7902e6f
chore: 🤖 update lockfile
punkbit Apr 2, 2026
c075cfe
chore: 🤖 create tokens-build script
punkbit Apr 2, 2026
c8d8008
chore: 🤖 use tokens-build script (package.json)
punkbit Apr 2, 2026
9385bee
docs: 📝 how-to use watch mode
punkbit Apr 2, 2026
dcf0751
refactor: 💡 use radius.full instead of radius.all for fully rounded
punkbit Apr 2, 2026
6385b7a
fix: 🐛 watch mode
punkbit Apr 2, 2026
0a5c92f
refactor: 💡 make sizing primitives categorical, named mechanically an…
punkbit Apr 9, 2026
a4ec5e2
chore: 🤖 format
punkbit Apr 9, 2026
26f51f3
refactor: 💡 use main branch colours as primitives
punkbit Apr 9, 2026
cc669a9
docs: 📝 update specification
punkbit Apr 9, 2026
ec84060
style: 💄 add two missing colours, e.g. bigStat/color/title
punkbit Apr 9, 2026
e49e246
style: 💄 color pass based in Dani's curation described as `support th…
punkbit Apr 10, 2026
fabdfd2
chore: 🤖 format
punkbit Apr 10, 2026
23f858b
chore: 🤖 add space-optical for input-padding-y and semantic token
punkbit Apr 14, 2026
ef98443
chore: 🤖 update typography tokens with new font/size/3xl, renaming ol…
punkbit Apr 14, 2026
5b2536d
chore: 🤖 add space xxs in semantics
punkbit Apr 14, 2026
c8b85f8
chore: 🤖 Updated color/chart with 11 colors including light/dark mode…
punkbit Apr 14, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions packages/click-ui/.changeset/add-design-tokens-package.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
---
"@clickhouse/design-tokens": minor
---

Initial release of the design-tokens package. Provides DTCG-compliant design token definitions for colors, spacing, radius, sizing, and typography. Includes Terrazzo-based CSS output generation.

**Package pathname:** `packages/design-tokens`

**Token Dictionary Location:** `packages/design-tokens/dictionary/`

- `primitives.dtcg.json`
- `semantic.dtcg.json` - Semantic color tokens (references primitives)
- `spacing.dtcg.json` - Spacing scale (8px base unit)
- `radius.dtcg.json` - Border radius scale
- `sizing.dtcg.json` - Icon and component sizes
- `typography.dtcg.json` - Font sizes, weights, and line heights

**Creating Tokens:** Add or modify tokens in the dictionary files following DTCG format:

```json
{
"$type": "dimension",
"$value": { "value": 8, "unit": "px" },
"$description": "8px, base spacing"
}
```

**Building:** Run `yarn tokens:build` to generate `packages/design-tokens/dist/tokens.css`.

**Configuration:** `packages/design-tokens/config.js` contains build settings:

- `CSS_VAR_PREFIX` - CSS variable prefix (default: `cui` → `--cui-*`)
- `DICTIONARY_PATH` - Token dictionary location
- `TOKEN_FILES` - Token files and import order

See `packages/design-tokens/SPECIFICATION.md` for naming conventions and detailed guidelines.
2 changes: 1 addition & 1 deletion packages/click-ui/.changeset/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"commit": false,
"fixed": [],
"linked": [],
"access": "restricted",
"access": "public",
"baseBranch": "main",
"updateInternalDependencies": "patch",
"ignore": []
Expand Down
1 change: 1 addition & 0 deletions packages/design-tokens/.prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
dist
9 changes: 9 additions & 0 deletions packages/design-tokens/.prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"endOfLine": "lf",
"printWidth": 90,
"semi": true,
"singleQuote": false,
"tabWidth": 2,
"trailingComma": "es5",
"useTabs": false
}
19 changes: 19 additions & 0 deletions packages/design-tokens/.scripts/bash/tokens-build
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/bin/bash

build_tokens() {
rm -rf ./dist
tz build
cat ./dist/tokens-primitives.css ./dist/tokens-semantic.css > ./dist/tokens.css
rm ./dist/tokens-primitives.css ./dist/tokens-semantic.css
echo "✓ Built tokens.css"
}

if [[ "$1" == "watch" ]]; then
echo "👀 Watching dictionary files for changes..."

build_tokens

chokidar "dictionary/**/*.json" -c "$(pwd)/.scripts/bash/tokens-build" --initial=false
else
build_tokens
fi
137 changes: 137 additions & 0 deletions packages/design-tokens/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,137 @@
# Design Tokens

[![Conventional Commits](https://img.shields.io/badge/Conventional%20Commits-1.0.0-blue.svg)](https://conventionalcommits.org)

ClickHouse Design System token definitions for colors, spacing, typography and more, following the DTCG standard.

## Quick Start

Install dependencies:

```sh
yarn
```

Build tokens for consumer apps:

```sh
yarn tokens:build
```

Optionaly, use "watch" mode for automatic builds on file changes:

```sh
yarn tokens:build:watch
```

## CSS Variable Prefix

All generated CSS variables use the `--cui-` prefix (Click UI). This prefix is defined in `config.js` to ensure consistent namespace variable names across all consumer client applications.

```css
--cui-color-background-base
--cui-space-100
--cui-radius-50
```

To customize the prefix, modify `CSS_VAR_PREFIX` in `config.js` and rebuild.

## Dark Mode

Semantic color tokens support light and dark mode variants. The build outputs CSS that applies:

- **Light mode**: `:root` and `[data-theme='light']`
- **Dark mode**: `@media (prefers-color-scheme: dark)` and `[data-theme='dark']`

Dark mode activates automatically via OS preference (no JS required), or explicitly via attribute:

```html
<html data-theme="dark"></html>
```

The `data-theme` attribute takes precedence, allowing users to override their OS preference.

## Token Specification

This package follows the [DTCG (Design Tokens Community Group)](https://www.designtokens.org) standard. The specification defines naming conventions, token categories, and metadata strategies for consistent design token usage across Figma and code.

### Token Categories

| Category | Naming Convention | Example |
| -------------- | ---------------------------------------------------------------------------------------------------- | --------------------------------------------------------------- |
| **Color** | Primitives: `color/{palette}/{step}`, Semantic: `color/{category}/{subcategory}/{hierarchy}/{state}` | `color/gray/50`, `color/background/interactive/primary/default` |
| **Spacing** | Percentage-based with 8px base unit | `space/100` (8px), `space/200` (16px) |
| **Radius** | Percentage-based scale | `radius/50` (4px), `radius/100` (8px) |
| **Sizing** | T-shirt sizes by type | `sizing/icon/md` (20px), `sizing/component/lg` (48px) |
| **Typography** | `font/{property}/{scale}` | `font/size/lg` (16px), `font/weight/semibold` (600) |

### Usage Examples

```css
/* Semantic color tokens */
.button {
background: var(--cui-color-background-interactive-primary-default);
color: var(--cui-color-foreground-default);
}

/* Spacing tokens */
.card {
padding: var(--cui-space-200); /* 16px */
gap: var(--cui-space-100); /* 8px */
}

/* Sizing tokens */
.icon {
width: var(--cui-sizing-icon-md); /* 20px */
}
```

### Lint Rules

To prevent inappropriate use of tokens (e.g., using primitives directly in component styles), configure lint rules:

**Stylelint**

Warn on primitive token usage:

```json
{
"rules": {
"declaration-property-value-disallowed-list": {
"/color|background|border/": [
"/--cui-color-(white|black|gray|blue|green|red|yellow|orange)-/"
]
}
}
}
```

**ESLint**

For CSS-in-JS (e.g., styled-components):

```json
{
"rules": {
"no-restricted-syntax": [
"warn",
{
"selector": "Literal[value=/--cui-color-(white|black|gray|blue|green|red|yellow|orange)-/]",
"message": "Use semantic tokens instead of primitive color tokens"
}
]
}
}
```

**Guideline**

> [!WARNING]
> Components should use semantic tokens (`--cui-color-background-*`). Primitives (`--cui-color-gray-*`) are exposed for theming and debugging but should not appear in component styles.

For complete details on naming conventions, metadata strategies, and implementation guidelines, see [SPECIFICATION.md](./SPECIFICATION.md).

# References

- [DTCG](https://www.designtokens.org)
- [Design Tokens Technical Reports 2025.10](https://www.designtokens.org/tr/2025.10/)
Loading
Loading