@locusgraph/tokens 0.3.0 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -14,7 +14,7 @@ pnpm add @locusgraph/tokens
14
14
 
15
15
  `@locusgraph/components/theme.css` already imports both; import tokens directly only in an app that does not use the components.
16
16
 
17
- Everything the theme defines is prefixed with `locus`: variables are `--locus-*` (light on `:root`, dark on `.dark`) and our classes, utilities and keyframes are `locus-*`. The Tailwind keys keep their names (`bg-surface`, `text-soft`, `bg-primary`, `text-muted-foreground`), now pointing at `--locus-*`. An app that also uses shadcn components and needs the shadcn variable names (`--background`, `--primary`, `--muted-foreground`, `--radius`, …) adds the optional aliases:
17
+ Everything the theme defines is prefixed with `locus`: variables are `--locus-*` (light on `:root`, dark on `.dark`) and our classes, utilities and keyframes are `locus-*`. The Tailwind keys keep their names (`bg-surface`, `text-faint`, `bg-primary`, `text-muted-foreground`), now pointing at `--locus-*`. An app that also uses shadcn components and needs the shadcn variable names (`--background`, `--primary`, `--muted-foreground`, `--radius`, …) adds the optional aliases:
18
18
 
19
19
  ```css
20
20
  @import "@locusgraph/tokens/shadcn.css";
@@ -22,14 +22,33 @@ Everything the theme defines is prefixed with `locus`: variables are `--locus-*`
22
22
 
23
23
  ## What `theme.css` holds
24
24
 
25
- - Palette: one white (`--locus-surface`, also `--locus-background`), text, muted, status colors and a dark set under `.dark`.
26
- - Hairlines: `--locus-border` is 13% of the text color mixed into the surface.
27
- - Square containers: every radius token is 0. Use `rounded-full` for pills.
25
+ - Palette: `--locus-background` for the page, `--locus-surface` for cards and panels, `--locus-foreground`, `--locus-muted-foreground` and `--locus-faint` for text tones, `--locus-muted` for fills, and a dark set under `.dark`. Every text tone passes WCAG AA on background, surface and muted in both themes.
26
+ - Role colors: `interactive` (clickable, on hover), `memory` (remembered), `good`, `warn` (waiting) and `destructive`. Color means state; chart series `--locus-s1` to `--locus-s8` carry no meaning.
27
+ - Hairlines: `--locus-border` is the text color mixed into the surface, 9% light and 10% dark.
28
+ - Square containers: every radius token is 0. Buttons, chips, badges, dots and avatars use `rounded-full`.
28
29
  - Fonts: Inter for text, Archivo for headings and the brand, Fira Code for mono labels.
30
+ - Type scale: Tailwind's steps plus `text-2xs` (0.6875rem) for badges and counters and `text-code` (0.8125rem) for code.
31
+ - Control heights: `h-control-xs` (1.5rem), `h-control-sm` (2rem), `h-control` (2.25rem) and `h-control-lg` (2.5rem), also as `size-control-*`.
32
+ - Focus: `locus-focus-ring` draws a 2px ring outside the element; `locus-focus-ring-inset` draws it inside for rows, tabs and scroll areas.
29
33
  - Base: 17px root size, tight balanced headings, `text-pretty` paragraphs.
30
34
  - Effects: `locus-brand-grid` and `locus-brand-grid-quiet` backgrounds, `locus-enter-cascade`, `locus-rises`, `locus-shimmer`, `locus-scroll-fade-b`, `locus-scroll-fade-x`, `locus-no-scrollbar`, `locus-scrollbar-none`, `locus-scrollbar-thin`, `locus-scrollbar-gutter-stable`, the `locus-eyebrow` label, `locus-ignites` and `locus-tracked`. Motion falls back to a fade under reduced motion.
31
35
 
32
- `typeset.css` styles long-form content inside `.typeset`; it is vendored from shadcn/typeset.
36
+ `typeset.css` styles long-form content inside `.typeset`, vendored from shadcn/typeset. Add `locus-typeset-chat` for agent replies: 14px, sans headings, tables without row rules.
37
+
38
+ ## Migrating from 0.3
39
+
40
+ The role colors are renamed so each one names its meaning, and the gray text tones are darker so they pass WCAG AA.
41
+
42
+ | 0.3 | 0.4 |
43
+ |---|---|
44
+ | `--locus-muted` (gray text) | `--locus-muted-foreground` |
45
+ | `--locus-ghost` (fill) | `--locus-muted` |
46
+ | `--locus-bad`, `text-bad` | `--locus-destructive`, `text-destructive` |
47
+ | `--locus-info`, `text-info` | `--locus-interactive`, `text-interactive` |
48
+ | `text-soft`, `border-line`, `bg-ghost`, `bg-btn`, `bg-btn-ink` | `text-muted-foreground`, `border-border`, `bg-muted`, `bg-primary`, `text-primary-foreground` |
49
+ | `locus-focus-ring`, `locus-focus-ring-inset`, `typeset-chat` | `locus-focus-ring`, `locus-focus-ring-inset`, `locus-typeset-chat` |
50
+
51
+ New: `--locus-memory` (`text-memory`), `--locus-destructive-foreground`, `text-2xs`, `text-code` and the `h-control-*` heights.
33
52
 
34
53
  ## Migrating from 0.2
35
54
 
package/dist/base.css CHANGED
@@ -60,6 +60,6 @@ body {
60
60
  }
61
61
 
62
62
  [data-rehype-pretty-code-figure] [data-highlighted-line] {
63
- background: var(--locus-ghost);
63
+ background: var(--locus-muted);
64
64
  box-shadow: inset 2px 0 var(--locus-border);
65
65
  }
@@ -57,9 +57,27 @@
57
57
 
58
58
  @utility locus-eyebrow {
59
59
  font-family: var(--font-mono);
60
- font-size: 11px;
61
- line-height: 1rem;
60
+ font-size: var(--text-2xs);
61
+ line-height: var(--text-2xs--line-height);
62
62
  letter-spacing: 0.05em;
63
63
  text-transform: uppercase;
64
- color: var(--locus-muted);
64
+ color: var(--locus-muted-foreground);
65
+ }
66
+
67
+ @utility locus-focus-ring {
68
+ outline: none;
69
+
70
+ &:focus-visible {
71
+ outline: 2px solid color-mix(in oklch, var(--color-ring) 70%, transparent);
72
+ outline-offset: 2px;
73
+ }
74
+ }
75
+
76
+ @utility locus-focus-ring-inset {
77
+ outline: none;
78
+
79
+ &:focus-visible {
80
+ outline: 2px solid color-mix(in oklch, var(--color-ring) 70%, transparent);
81
+ outline-offset: -2px;
82
+ }
65
83
  }
package/dist/typeset.css CHANGED
@@ -3,3 +3,84 @@
3
3
  .typeset {
4
4
  --radius: var(--locus-radius);
5
5
  }
6
+
7
+ .locus-typeset-chat {
8
+ --typeset-font-body: var(--font-sans);
9
+ --typeset-font-heading: var(--font-sans);
10
+ --typeset-font-mono: var(--font-mono);
11
+ --typeset-size: 14px;
12
+ --typeset-leading: 1.65;
13
+ --typeset-flow: 0.85em;
14
+ }
15
+
16
+ @layer components {
17
+ .typeset.locus-typeset-chat {
18
+ font-size: var(--typeset-size);
19
+ }
20
+
21
+ .typeset.locus-typeset-chat
22
+ *:not(:where(.not-typeset, [data-not-typeset], .not-typeset *, [data-not-typeset] *)) {
23
+ &:where(h1, h2, h3, h4) {
24
+ letter-spacing: -0.01em;
25
+ }
26
+ &:where(h1) {
27
+ font-size: 1.15em;
28
+ margin-block-start: calc(var(--typeset-flow) * 2);
29
+ }
30
+ &:where(h2) {
31
+ font-size: 1.075em;
32
+ margin-block-start: calc(var(--typeset-flow) * 1.75);
33
+ }
34
+ &:where(h3) {
35
+ font-size: 1em;
36
+ margin-block-start: calc(var(--typeset-flow) * 1.5);
37
+ }
38
+ &:where(h4) {
39
+ font-size: 1em;
40
+ font-weight: 500;
41
+ color: var(--typeset-muted);
42
+ margin-block-start: calc(var(--typeset-flow) * 1.5);
43
+ }
44
+ &:where(h1 + *, h2 + *, h3 + *, h4 + *) {
45
+ margin-block-start: 0.5em;
46
+ }
47
+ &:where(a) {
48
+ color: var(--color-foreground);
49
+ text-decoration-color: var(--color-faint);
50
+ text-underline-offset: 3px;
51
+ transition: color 150ms, text-decoration-color 150ms;
52
+ }
53
+ &:where(a:hover) {
54
+ color: var(--color-interactive);
55
+ text-decoration-color: var(--color-interactive);
56
+ }
57
+ &:where(li) {
58
+ margin-block-start: 0.35em;
59
+ }
60
+ &:where(blockquote) {
61
+ color: var(--typeset-muted);
62
+ }
63
+ &:where(hr) {
64
+ margin-block-start: calc(var(--typeset-flow) * 2);
65
+ }
66
+ &:where(table) {
67
+ border-block-end: 0;
68
+ }
69
+ &:where(thead th) {
70
+ font-size: 0.86em;
71
+ color: var(--color-faint);
72
+ padding: 0.45em 0.85em;
73
+ border-block-end: 1px solid var(--typeset-rule);
74
+ }
75
+ &:where(:is(tbody, tfoot) :is(td, th)) {
76
+ padding: 0.4em 0.85em;
77
+ border-block-start: 0;
78
+ }
79
+ &:where(th:first-child, td:first-child) {
80
+ padding-inline-start: 0;
81
+ }
82
+ &:where(th:last-child, td:last-child) {
83
+ padding-inline-end: 0;
84
+ }
85
+ }
86
+ }
@@ -1,4 +1,4 @@
1
- export type ColorName = "surface" | "background" | "foreground" | "muted" | "faint" | "btn" | "btnInk" | "ghost" | "good" | "bad" | "info" | "warn" | "brandGlow";
1
+ export type ColorName = "surface" | "background" | "foreground" | "mutedForeground" | "faint" | "btn" | "btnInk" | "muted" | "interactive" | "memory" | "good" | "warn" | "destructive" | "brandGlow";
2
2
  export type Palette = Record<ColorName, string>;
3
3
  export declare const lightColors: Palette;
4
4
  export declare const darkColors: Palette;
@@ -2,30 +2,32 @@ export const lightColors = {
2
2
  surface: "#ffffff",
3
3
  background: "#fafafa",
4
4
  foreground: "#09090b",
5
- muted: "#71717a",
6
- faint: "#a1a1aa",
5
+ mutedForeground: "#52525b",
6
+ faint: "#6b6b73",
7
7
  btn: "#18181b",
8
8
  btnInk: "#fafafa",
9
- ghost: "#f4f4f5",
9
+ muted: "#f4f4f5",
10
+ interactive: "#1b66c4",
11
+ memory: "#4a3aa7",
10
12
  good: "#006300",
11
- bad: "#d03b3b",
12
- info: "#1f6fd1",
13
13
  warn: "#a15c00",
14
+ destructive: "#c53030",
14
15
  brandGlow: "#0099ff",
15
16
  };
16
17
  export const darkColors = {
17
18
  surface: "#111113",
18
19
  background: "#0c0c0d",
19
20
  foreground: "#ededed",
20
- muted: "#a1a1aa",
21
- faint: "#71717a",
21
+ mutedForeground: "#a1a1aa",
22
+ faint: "#85858e",
22
23
  btn: "#ededed",
23
24
  btnInk: "#0a0a0a",
24
- ghost: "#1b1b1d",
25
+ muted: "#1b1b1d",
26
+ interactive: "#5b9df0",
27
+ memory: "#9085e9",
25
28
  good: "#0ca30c",
26
- bad: "#e66767",
27
- info: "#5b9df0",
28
29
  warn: "#e0a400",
30
+ destructive: "#e66767",
29
31
  brandGlow: "#0099ff",
30
32
  };
31
33
  export const hairlineMix = 0.09;
@@ -3,39 +3,31 @@
3
3
  @theme inline {
4
4
  --color-background: var(--locus-background);
5
5
  --color-surface: var(--locus-surface);
6
- --color-line: var(--locus-border);
7
6
  --color-foreground: var(--locus-foreground);
8
- --color-soft: var(--locus-muted);
9
7
  --color-faint: var(--locus-faint);
10
- --color-btn: var(--locus-btn);
11
- --color-btn-ink: var(--locus-btn-ink);
12
- --color-ghost: var(--locus-ghost);
13
- --color-s1: var(--locus-s1);
14
- --color-s2: var(--locus-s2);
15
- --color-s3: var(--locus-s3);
8
+ --color-interactive: var(--locus-interactive);
9
+ --color-memory: var(--locus-memory);
16
10
  --color-good: var(--locus-good);
17
- --color-bad: var(--locus-bad);
18
- --color-info: var(--locus-info);
19
11
  --color-warn: var(--locus-warn);
20
12
  --color-border: var(--locus-border);
21
13
  --color-input: var(--locus-input);
22
14
  --color-skeleton: var(--locus-skeleton);
23
15
  --color-scrim: var(--locus-scrim);
24
- --color-ring: var(--locus-s1);
16
+ --color-ring: var(--locus-interactive);
25
17
  --color-primary: var(--locus-btn);
26
18
  --color-primary-foreground: var(--locus-btn-ink);
27
- --color-secondary: var(--locus-ghost);
19
+ --color-secondary: var(--locus-muted);
28
20
  --color-secondary-foreground: var(--locus-foreground);
29
- --color-accent: var(--locus-ghost);
21
+ --color-accent: var(--locus-muted);
30
22
  --color-accent-foreground: var(--locus-foreground);
31
- --color-muted: var(--locus-ghost);
32
- --color-muted-foreground: var(--locus-muted);
23
+ --color-muted: var(--locus-muted);
24
+ --color-muted-foreground: var(--locus-muted-foreground);
33
25
  --color-popover: var(--locus-popover);
34
26
  --color-popover-foreground: var(--locus-foreground);
35
27
  --color-card: var(--locus-surface);
36
28
  --color-card-foreground: var(--locus-foreground);
37
- --color-destructive: var(--locus-bad);
38
- --color-destructive-foreground: #ffffff;
29
+ --color-destructive: var(--locus-destructive);
30
+ --color-destructive-foreground: var(--locus-destructive-foreground);
39
31
  --color-sidebar: var(--locus-sidebar);
40
32
  --color-sidebar-foreground: var(--locus-sidebar-foreground);
41
33
  --color-sidebar-primary: var(--locus-sidebar-primary);
@@ -49,6 +41,14 @@
49
41
  --font-mono: var(--locus-font-fira-code);
50
42
  --font-brand: var(--locus-font-archivo);
51
43
  --shadow-overlay: var(--locus-overlay-shadow);
44
+ --text-2xs: 0.6875rem;
45
+ --text-2xs--line-height: 1rem;
46
+ --text-code: 0.8125rem;
47
+ --text-code--line-height: 1.25rem;
48
+ --spacing-control-xs: 1.5rem;
49
+ --spacing-control-sm: 2rem;
50
+ --spacing-control: 2.25rem;
51
+ --spacing-control-lg: 2.5rem;
52
52
  --radius-xs: 0px;
53
53
  --radius-sm: 0px;
54
54
  --radius-md: 0px;
@@ -3,11 +3,11 @@
3
3
  --locus-background: #fafafa;
4
4
  --locus-foreground: #09090b;
5
5
  --locus-border: color-mix(in oklch, var(--locus-foreground) 9%, var(--locus-surface));
6
- --locus-muted: #71717a;
7
- --locus-faint: #a1a1aa;
6
+ --locus-muted-foreground: #52525b;
7
+ --locus-faint: #6b6b73;
8
8
  --locus-btn: #18181b;
9
9
  --locus-btn-ink: #fafafa;
10
- --locus-ghost: #f4f4f5;
10
+ --locus-muted: #f4f4f5;
11
11
  --locus-s1: #2a78d6;
12
12
  --locus-s2: #eb6834;
13
13
  --locus-s3: #1baf7a;
@@ -16,10 +16,12 @@
16
16
  --locus-s6: #008300;
17
17
  --locus-s7: #4a3aa7;
18
18
  --locus-s8: #e34948;
19
+ --locus-interactive: #1b66c4;
20
+ --locus-memory: #4a3aa7;
19
21
  --locus-good: #006300;
20
- --locus-bad: #d03b3b;
21
- --locus-info: #1f6fd1;
22
22
  --locus-warn: #a15c00;
23
+ --locus-destructive: #c53030;
24
+ --locus-destructive-foreground: #ffffff;
23
25
  --locus-popover: var(--locus-surface);
24
26
  --locus-input: color-mix(in oklch, var(--locus-foreground) 26%, var(--locus-surface));
25
27
  --locus-skeleton: color-mix(in oklch, var(--locus-foreground) 9%, var(--locus-surface));
@@ -31,18 +33,18 @@
31
33
  --locus-sidebar-foreground: var(--locus-foreground);
32
34
  --locus-sidebar-primary: var(--locus-btn);
33
35
  --locus-sidebar-primary-foreground: var(--locus-btn-ink);
34
- --locus-sidebar-accent: var(--locus-ghost);
36
+ --locus-sidebar-accent: var(--locus-muted);
35
37
  --locus-sidebar-accent-foreground: var(--locus-foreground);
36
38
  --locus-sidebar-border: var(--locus-border);
37
- --locus-sidebar-ring: var(--locus-s1);
39
+ --locus-sidebar-ring: var(--locus-interactive);
38
40
  --locus-font-inter: "Inter Variable", ui-sans-serif, system-ui, sans-serif;
39
41
  --locus-font-archivo: "Archivo Variable", ui-sans-serif, system-ui, sans-serif;
40
42
  --locus-font-fira-code: "Fira Code Variable", ui-monospace, monospace;
41
- --locus-chart-1: var(--color-blue-300);
42
- --locus-chart-2: var(--color-blue-500);
43
- --locus-chart-3: var(--color-blue-600);
44
- --locus-chart-4: var(--color-blue-700);
45
- --locus-chart-5: var(--color-blue-800);
43
+ --locus-chart-1: var(--locus-s1);
44
+ --locus-chart-2: var(--locus-s2);
45
+ --locus-chart-3: var(--locus-s3);
46
+ --locus-chart-4: var(--locus-s4);
47
+ --locus-chart-5: var(--locus-s5);
46
48
  }
47
49
 
48
50
  .dark {
@@ -50,23 +52,25 @@
50
52
  --locus-background: #0c0c0d;
51
53
  --locus-foreground: #ededed;
52
54
  --locus-border: color-mix(in oklch, var(--locus-foreground) 10%, var(--locus-surface));
53
- --locus-muted: #a1a1aa;
54
- --locus-faint: #71717a;
55
+ --locus-muted-foreground: #a1a1aa;
56
+ --locus-faint: #85858e;
55
57
  --locus-btn: #ededed;
56
58
  --locus-btn-ink: #0a0a0a;
57
- --locus-ghost: #1b1b1d;
59
+ --locus-muted: #1b1b1d;
58
60
  --locus-s1: #3987e5;
59
61
  --locus-s2: #d95926;
60
62
  --locus-s3: #199e70;
61
63
  --locus-s4: #c98500;
62
64
  --locus-s5: #d55181;
63
- --locus-s6: #008300;
65
+ --locus-s6: #2a9d2a;
64
66
  --locus-s7: #9085e9;
65
67
  --locus-s8: #e66767;
68
+ --locus-interactive: #5b9df0;
69
+ --locus-memory: #9085e9;
66
70
  --locus-good: #0ca30c;
67
- --locus-bad: #e66767;
68
- --locus-info: #5b9df0;
69
71
  --locus-warn: #e0a400;
72
+ --locus-destructive: #e66767;
73
+ --locus-destructive-foreground: #0a0a0a;
70
74
  --locus-input: color-mix(in oklch, var(--locus-foreground) 24%, var(--locus-surface));
71
75
  --locus-skeleton: color-mix(in oklch, var(--locus-foreground) 11%, var(--locus-surface));
72
76
  --locus-popover: #18181a;
@@ -8,16 +8,17 @@
8
8
  --popover-foreground: var(--locus-popover-foreground);
9
9
  --primary: var(--locus-btn);
10
10
  --primary-foreground: var(--locus-btn-ink);
11
- --secondary: var(--locus-ghost);
11
+ --secondary: var(--locus-muted);
12
12
  --secondary-foreground: var(--locus-foreground);
13
- --muted: var(--locus-ghost);
14
- --muted-foreground: var(--locus-muted);
15
- --accent: var(--locus-ghost);
13
+ --muted: var(--locus-muted);
14
+ --muted-foreground: var(--locus-muted-foreground);
15
+ --accent: var(--locus-muted);
16
16
  --accent-foreground: var(--locus-foreground);
17
- --destructive: var(--locus-bad);
17
+ --destructive: var(--locus-destructive);
18
+ --destructive-foreground: var(--locus-destructive-foreground);
18
19
  --border: var(--locus-border);
19
20
  --input: var(--locus-input);
20
- --ring: var(--locus-s1);
21
+ --ring: var(--locus-interactive);
21
22
  --radius: var(--locus-radius);
22
23
  --sidebar: var(--locus-sidebar);
23
24
  --sidebar-foreground: var(--locus-sidebar-foreground);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@locusgraph/tokens",
3
- "version": "0.3.0",
3
+ "version": "0.4.0",
4
4
  "description": "LocusGraph design tokens: theme CSS for Tailwind v4, typography, brand effects and motion, plus the color and type values for places CSS cannot reach.",
5
5
  "license": "MIT",
6
6
  "repository": {