Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
65 commits
Select commit Hold shift + click to select a range
01a5613
chore: 🤖 create design-tokens package placeholder's package.json
punkbit Mar 24, 2026
ea88fff
docs: 📝 add initial README.md
punkbit Mar 24, 2026
f27d5f4
docs: 📝 add initial README.md
punkbit Mar 24, 2026
55e421e
docs: 📝 add token SPECIFICATION.md
punkbit Mar 24, 2026
9a01750
chore: 🤖 update yarn.lock
punkbit Mar 24, 2026
c9d2659
fix: 🐛 exports
punkbit Mar 24, 2026
6ffa1c5
chore: 🤖 add dictionary containing DTCG token files, e.g. primitives.…
punkbit Mar 24, 2026
9d69000
chore: 🤖 terrazzo dictionary to css builder
punkbit Mar 24, 2026
02d82c3
chore: 🤖 add note
punkbit Mar 25, 2026
3bd2d2c
docs: 📝 distribution strategy
punkbit Mar 25, 2026
9125fc8
docs: 📝 brief token spec in readme
punkbit Mar 25, 2026
e5c9116
docs: 📝 lint rules
punkbit Mar 25, 2026
f49ad37
fix: 🐛 remove leading 0
punkbit Mar 25, 2026
8896cb9
fix: 🐛 packages require a build command
punkbit Mar 25, 2026
b7435f7
fix: 🐛 typo
punkbit Mar 25, 2026
0d60d1b
fix: 🐛 typography missing in import order
punkbit Mar 25, 2026
3ebe176
fix: 🐛 typo
punkbit Mar 25, 2026
d7aecb0
chore: 🤖 remove TODO
punkbit Mar 25, 2026
f4a3faf
fix: 🐛 Tokens meant for CSS layout should use : "dimension" with stri…
punkbit Mar 25, 2026
a848a9b
chore: 🤖 lint/test placeholders
punkbit Mar 25, 2026
0c5defd
fix: 🐛 spacing description misplaced
punkbit Mar 25, 2026
ef816f2
fix: 🐛 removed the non-standard "style" condition.
punkbit Mar 25, 2026
3c37962
fix: 🐛 remove empty icon block from token dictionary
punkbit Mar 25, 2026
dfc372f
fix: 🐛 both should say Secondary button …
punkbit Mar 25, 2026
a7623e1
fix: 🐛 table now accurately reflects the actual token paths used in …
punkbit Mar 25, 2026
945be67
chore: 🤖 add changeset
punkbit Mar 25, 2026
10e6a81
chore: 🤖 update changeset to include instructions
punkbit Mar 25, 2026
5625975
fix: 🐛 Changed press to active for color.background.interactive.secon…
punkbit Mar 25, 2026
86f499c
fix: 🐛 Changed from {color.gray.805} to {color.gray.800} to match th…
punkbit Mar 25, 2026
d767696
chore: 🤖 use tz check as linter
punkbit Mar 25, 2026
661dfe3
refactor: 💡 created config.js with centralized settings
punkbit Mar 25, 2026
74704a1
refactor: 💡 hex values consistency lowercase
punkbit Mar 25, 2026
515bc7c
chore: 🤖 add TODO
punkbit Mar 25, 2026
896b5d1
chore: 🤖 add mode selector
punkbit Mar 25, 2026
475b796
chore: 🤖 add format
punkbit Mar 25, 2026
9f0a3e5
fix: 🐛 no visual hover distinction in light mode for the primary button
punkbit Mar 25, 2026
b5a653e
fix: 🐛 border muted in dark mode
punkbit Mar 25, 2026
84cc724
fix: 🐛 both secondary button states, now the ghost button has appropr…
punkbit Mar 25, 2026
3c8783e
chore: 🤖 skip test
punkbit Mar 25, 2026
fd98f39
fix: 🐛 inconsistent values
punkbit Mar 25, 2026
1b2270b
chore: 🤖 dark mode support via OS support
punkbit Mar 25, 2026
67a4ed6
refactor: 💡 gray naming
punkbit Mar 26, 2026
6252e12
refactor: 💡 remove resolver, use mode
punkbit Mar 26, 2026
80afee9
refactor: 💡 gray vs neutral vs charcoal palettes
punkbit Mar 26, 2026
f13eefc
refactor: 💡 Broken token reference (semantic.dtcg.json:74): color.bac…
punkbit Mar 26, 2026
a7aad3b
refactor: 💡 opacity tokens now live under neutral/opacity/{percent} w…
punkbit Mar 26, 2026
5a2b9d1
refactor: 💡 gray descriptions colour refs
punkbit Mar 26, 2026
6d9f367
refactor: 💡 changed {color.gray.650} to {color.neutral.650} in semant…
punkbit Mar 26, 2026
c42396f
chore: 🤖 make terrazzo generate final css with legacy hex
punkbit Mar 26, 2026
7be3452
refactor: 💡 convert to compliant DTCG colour space
punkbit Mar 26, 2026
d81c5ea
chore: 🤖 clear dist before build
punkbit Mar 26, 2026
b322ce2
fix: 🐛 token themes light/dark mode handling
punkbit Mar 26, 2026
4717fee
refactor: 💡 transform js into ts
punkbit Mar 27, 2026
8703562
chore: 🤖 add formatter
punkbit Mar 27, 2026
cb58116
style(tokens): 💄 transform tokens into solid colours
punkbit Mar 30, 2026
037f6e4
style(tokens): 💄 primitives, moved semantic meaning to semantic layer
punkbit Mar 30, 2026
b96d988
style(tokens): 💄 All Semantic Names Removed from Primitives
punkbit Mar 30, 2026
aaec2ea
style(tokens): 💄 copy latest tokens from chore/monorepo-figma-design-…
punkbit Mar 30, 2026
82c5935
chore: 🤖 update lockfile
punkbit Mar 31, 2026
b5b7357
chore: 🤖 set access as public
punkbit Mar 31, 2026
7dc7958
fix: 🐛 remove duplicates
punkbit Mar 31, 2026
1297c2f
chore: 🤖 re-enable colour lint
punkbit Mar 31, 2026
3aa91ff
fix: 🐛 publishConfig
punkbit Mar 31, 2026
4916f5d
refactor: 💡 make radius semantic as t-shirt sizing
punkbit Mar 31, 2026
ae8bec7
refactor: 💡 separate primitives from theme semantic tokens
punkbit Mar 31, 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
}
131 changes: 131 additions & 0 deletions packages/design-tokens/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,131 @@
# 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
```

## 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/200` (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