Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
5 changes: 5 additions & 0 deletions .changeset/surface-color-tokens.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@cube-dev/ui-kit': minor
---

Add `#surface`, `#surface-2`, and `#surface-3` for layered backgrounds. `#light` now aliases `#surface-3`. Defaults that used `#dark-bg` (CopySnippet, CopyPasteBlock, disabled theme sample, scrollbar track, Storybook playground) use `#surface-2`. File- and radio-style tab fills use the surface scale instead of `#light` / `#white`. Prefer `#surface-2` over legacy `#dark-bg`; TypeScript named-color augmentation lists the surface tokens and no longer includes `dark-bg`.
2 changes: 1 addition & 1 deletion docs/Usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ Each semantic group provides a base color and variants following the pattern: `#

### Neutral Scales

**Dark scale:** `#dark`, `#dark-01` through `#dark-05`, `#dark-bg` — six-step neutral scale from near-black to light gray.
**Dark scale:** `#dark`, `#dark-01` through `#dark-05`neutral scale from near-black to light gray. **Surfaces:** `#surface`, `#surface-2`, `#surface-3` — layered UI backgrounds.

**Purple scale:** `#purple-01` through `#purple-04` — additional purple shades for gradients and accents.

Expand Down
2 changes: 1 addition & 1 deletion docs/components/content/CopyPasteBlock.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ A block that displays a value with copy-to-clipboard functionality. Supports pas

### Style Defaults

- `fill` — `#dark-bg`
- `fill` — `#surface-2`
- `radius` — `1r`
- `cursor` — pointer
- `preset` — `t3` (switches to `t2` when `size="large"`)
Expand Down
2 changes: 1 addition & 1 deletion docs/components/content/CopySnippet.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ A code block with copy-to-clipboard functionality and syntax highlighting. Exten

### Style Defaults

- `fill` — `#dark-bg`
- `fill` — `#surface-2`
- `border` — `0`
- `radius` — `1r`
- `padding` — `0`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ A block that displays a value with copy-to-clipboard functionality. Supports pas

### Style Defaults

- `fill` — `#dark-bg`
- `fill` — `#surface-2`
- `radius` — `1r`
- `cursor` — pointer
- `preset` — `t3` (switches to `t2` when `size="large"`)
Expand Down
2 changes: 1 addition & 1 deletion src/components/content/CopyPasteBlock/CopyPasteBlock.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ const CopyPasteBlockElement = tasty(Card, {
qa: 'CopyPasteBlock',
styles: {
display: 'grid',
fill: '#dark-bg',
fill: '#surface-2',
radius: '1r',
padding: {
'': '0 1px',
Expand Down
2 changes: 1 addition & 1 deletion src/components/content/CopySnippet/CopySnippet.docs.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ A code block with copy-to-clipboard functionality and syntax highlighting. Exten

### Style Defaults

- `fill` — `#dark-bg`
- `fill` — `#surface-2`
- `border` — `0`
- `radius` — `1r`
- `padding` — `0`
Expand Down
2 changes: 1 addition & 1 deletion src/components/content/CopySnippet/CopySnippet.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
multiline: false,
},

'& code': {

Check warning on line 48 in src/components/content/CopySnippet/CopySnippet.tsx

View workflow job for this annotation

GitHub Actions / Tests & lint

Avoid nested selectors ('& code'). Use sub-element styling with capitalized keys and data-element attributes instead
font: {
'': 'monospace',
serif: true,
Expand Down Expand Up @@ -94,7 +94,7 @@
styles: {
display: 'grid',
gridRows: 'minmax(0, 1fr)',
fill: '#dark-bg',
fill: '#surface-2',
border: 0,
padding: 0,
preset: 'default',
Expand Down
8 changes: 4 additions & 4 deletions src/components/navigation/Tabs/styled.ts
Original file line number Diff line number Diff line change
Expand Up @@ -217,10 +217,10 @@ export const TabElement = tasty(Item, {
fill: {
'': '#clear',
'hovered & !type=narrow': '#dark.03',
'type=file': '#light',
'type=file & hovered': '#light.5',
'type=radio & hovered': '#white.5',
'(type=file | type=radio) & selected': '#white',
'type=file': '#surface-3',
'type=file & hovered': '#surface-3.5',
'type=radio & hovered': '#surface.5',
'(type=file | type=radio) & selected': '#surface',
},
border: {
'': '#clear',
Expand Down
2 changes: 1 addition & 1 deletion src/data/themes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export default {
border: '#note.20',
},
disabled: {
fill: '#dark-bg',
fill: '#surface-2',
color: '#dark-03',
border: '#dark.20',
},
Expand Down
2 changes: 1 addition & 1 deletion src/stories/Usage.docs.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ Each semantic group provides a base color and variants following the pattern: `#

### Neutral Scales

**Dark scale:** `#dark`, `#dark-01` through `#dark-05`, `#dark-bg` — six-step neutral scale from near-black to light gray.
**Dark scale:** `#dark`, `#dark-01` through `#dark-05`neutral scale from near-black to light gray. **Surfaces:** `#surface`, `#surface-2`, `#surface-3` — layered UI backgrounds.

**Purple scale:** `#purple-01` through `#purple-04` — additional purple shades for gradients and accents.

Expand Down
2 changes: 1 addition & 1 deletion src/stories/playground/PlaygroundOutput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const OutputContent = tasty({
overflow: 'auto',
padding: '2x',
margin: 0,
fill: '#dark-bg',
fill: '#surface-2',
},
});

Expand Down
4 changes: 3 additions & 1 deletion src/tasty-augment.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@ declare module '@tenphi/tasty' {
'dark-03': true;
'dark-04': true;
'dark-05': true;
'dark-bg': true;
surface: true;
'surface-2': true;
'surface-3': true;
text: true;
primary: true;
disabled: true;
Expand Down
2 changes: 1 addition & 1 deletion src/tokens/base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,6 @@ export const BASE_TOKENS: Styles = {
'$scrollbar-radius': '1.5r',
'#scrollbar-thumb': '#text.5',
'#scrollbar-outline': '#clear',
'#scrollbar-bg': '#dark-bg',
'#scrollbar-bg': '#surface-2',
'#scrollbar-corner': '#clear',
};
11 changes: 8 additions & 3 deletions src/tokens/colors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,15 @@ export const COLOR_TOKENS: Styles = {
'#dark-03': okhsl(PURPLE_HUE, 19, 49),
'#dark-04': okhsl(PURPLE_HUE, 14, 67),
'#dark-05': okhsl(PURPLE_HUE, 14, 86),
'#dark-bg': okhsl(PURPLE_HUE, 21, 98),

// Light
'#light': okhsl(PURPLE_HUE, 14, 97),
// Surfaces
'#surface': okhsl(PURPLE_HUE, 21, 100),
'#surface-2': okhsl(PURPLE_HUE, 21, 98),
'#surface-3': okhsl(PURPLE_HUE, 21, 96),

// Legacy
'#light': '#surface-3',
'#dark-bg': okhsl(PURPLE_HUE, 21, 98),

// Black & White
'#white': 'okhsl(0 0% 100%)',
Expand Down
4 changes: 3 additions & 1 deletion tasty.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,9 @@ export default {
'#dark-03',
'#dark-04',
'#dark-05',
'#dark-bg',
'#surface',
'#surface-2',
'#surface-3',
'#light',
'#danger',
'#danger-text',
Expand Down
Loading