@greendrake/theme 0.3.0 → 0.5.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
@@ -26,20 +26,20 @@ Design tokens, document-level element styling (links, lists, quotes, body defaul
26
26
 
27
27
  Mixins exported by the root entry: `light-dark($light, $dark)`, `button-colors`, `overlay-icon-button($size)`, `wider-than-max-content` (plus `$max-content-width`). Framework-free SCSS primitives (breakpoints, z-layers, icon masks, font-face generation) live below this package in `@greendrake/scss-kit`.
28
28
 
29
- ## CSS custom property contract
29
+ ## CSS custom properties
30
30
 
31
- `@greendrake/ui` components render correctly only when the custom properties below are defined. This package's two entries cover part of the contract; the rest is the consuming app's responsibility (typically set in its palette maps or `:root`).
31
+ What this package's two entries define, and what its own rules and mixins read from the app. Components styled against custom properties of their own list them in their own packages; an app on this theme defines whichever of those it leaves open (typically in its palette maps or `:root`).
32
32
 
33
33
  ### Defined by `@greendrake/theme` (root entry)
34
34
 
35
35
  | Property | Value | Notes |
36
36
  | --- | --- | --- |
37
- | `--space-1` … `--space-6` | 4/8/12/16/24/28px | spacing scale; `--space-1`…`--space-4` are read by ui components |
38
- | `--font-xs` … `--font-2xl` | 11/13/16/20/24/32px | font-size scale; `--font-xs` and `--font-md` are read by ui components |
37
+ | `--space-1` … `--space-6` | 4/8/12/16/24/28px | spacing scale |
38
+ | `--font-xs` … `--font-2xl` | 11/13/16/20/24/32px | font-size scale |
39
39
  | `--overlay-button-bg`, `--overlay-button-bg-hover` | `rgb(0 0 0 / 60%)`, `rgb(0 0 0 / 85%)` | consumed by the `overlay-icon-button` mixin |
40
- | `--error-color` | `#ff4800` | semantic status color for app styling (not read by ui components) |
41
- | `--warning-color` | `#890095` | semantic status color for app styling (not read by ui components) |
42
- | `--accent-color` | `#0aa13e` | read by ui components (checkboxes, highlights) |
40
+ | `--error-color` | `#ff4800` | semantic status colour |
41
+ | `--warning-color` | `#890095` | semantic status colour |
42
+ | `--accent-color` | `#0aa13e` | accent for active and checked states |
43
43
 
44
44
  ### Defined by `@greendrake/theme/dashboard-palette` (opt-in, light and dark values)
45
45
 
@@ -57,36 +57,27 @@ Mixins exported by the root entry: `light-dark($light, $dark)`, `button-colors`,
57
57
  | `--spinner-color` | `#ccc` | `#ccc` |
58
58
  | `--page-background` | `#e6e6e6` | `#202020` |
59
59
  | `--page-vignette-color` | `#cdcdcd` | `#0c0c0c` |
60
+ | `--modal-background`, `--modal-border-radius` | `var(--background-color)`, `var(--border-radius)` | same |
61
+ | `--modal-box-shadow`, `--modal-backdrop-filter`, `--modal-window-backdrop-filter` | a light glow, `brightness(0.4)`, `blur(8px)` | same |
60
62
 
61
- The `--page-*` pair feeds the `page-vignette` mixin (a flat canvas tone with a box-shadow edge falloff — deliberately not a radial gradient, whose page-sized form Firefox can mis-render as a bright dot at its centre). The dashboard preset emits it; an app on a palette of its own defines the pair and includes the mixin itself.
63
+ The `--page-*` pair feeds the `page-vignette` mixin (a flat canvas tone with a box-shadow edge falloff — deliberately not a radial gradient, whose page-sized form Firefox can mis-render as a bright dot at its centre). The dashboard preset emits it; an app on a palette of its own defines the pair and includes the mixin itself. The `--modal-*` group is the dashboard look's modal chrome: a dark-glass window over a dimmed backdrop.
62
64
 
63
- Apps not using the dashboard palette must define at least the `--font-color`/`--background-color`/`--form-background*`/`--border-color*`/`--spinner-color` group themselves — ui components read them with no fallback.
65
+ An app not on the dashboard palette defines the palette group itself: this package's own rules read `--font-color`, `--background-color`, `--form-background*`, `--border-color*`, `--link-color-hover` and `--spinner-color` with no fallback.
64
66
 
65
67
  ### Required from the consuming app (defined by neither entry, read with no fallback)
66
68
 
67
69
  | Property | Read by |
68
70
  | --- | --- |
69
- | `--border-radius` | form controls, modals, tables, `overlay-icon-button` |
70
- | `--icon-size` | `@greendrake/scss-kit` `icon` mixin, icon-bearing ui components |
71
- | `--input-background` | text inputs |
72
- | `--line-height-normal` | text layout in ui components |
73
- | `--modal-background` | modal window |
74
- | `--modal-border-radius` | modal window |
75
- | `--spinner-side-color` | global `.spinner` rule, `img-spinner` mixin (typically `var(--form-background)`) |
76
- | `--link-color` | document link styling in this package |
77
- | `--blockquote-colour` | blockquote styling in this package |
71
+ | `--border-radius` | form-control styling, `overlay-icon-button` |
72
+ | `--spinner-side-color` | global `.spinner` rule (typically `var(--form-background)`) |
73
+ | `--link-color` | document link styling |
74
+ | `--blockquote-colour` | blockquote styling |
78
75
  | `--button-background` | `button-colors` mixin |
79
76
 
80
- ### Optional (ui components read them with a fallback)
77
+ ## Global spinner
81
78
 
82
- `--cell-padding`, `--circular-progress-arc`, `--circular-progress-label`, `--circular-progress-track`, `--list-row-padding`, `--modal-backdrop-filter`, `--modal-box-shadow`, `--modal-button-min-width`, `--modal-max-width`, `--modal-window-backdrop-filter`, `--row-border-bottom`, `--row-select-color`, `--row-select-color-hover`, `--tree-line-color`.
83
-
84
- Component-scoped properties with local defaults (`--checkbox-size`, `--switch-width`, `--switch-height`, `--switch-knob`) are documented per component in `@greendrake/ui`.
85
-
86
- ## Global spinner contract
87
-
88
- This package defines the `spinner` keyframes and the `.spinner` / `body.spinner` / `div.spinner` rules that `@greendrake/ui`'s async controls and `@greendrake/scss-kit`'s `img-spinner` mixin rely on. They consume `--spinner-color` (palette) and `--spinner-side-color` (app).
79
+ This package defines the `spinner` keyframes and the `.spinner` / `body.spinner` / `div.spinner` rules, for components that show progress by toggling a `spinner` class and for `@greendrake/scss-kit`'s `img-spinner` mixin. They consume `--spinner-color` (palette) and `--spinner-side-color` (app).
89
80
 
90
81
  ## Not included
91
82
 
92
- Tooltip (tippy) skin and select-control skin ship with the components that need them in `@greendrake/ui`; this package styles only plain document elements.
83
+ Component skins (tooltips, select controls) ship with the components that need them; this package styles only plain document elements.
package/_index.scss CHANGED
@@ -10,8 +10,8 @@
10
10
  @forward 'mixins';
11
11
 
12
12
  :root {
13
- // Feeds ui's TheWrap width cap; single-sourced from the SCSS constant the
14
- // wider-than-max-content mixin also uses.
13
+ // The content width cap for layout wrappers; single-sourced from the SCSS
14
+ // constant the wider-than-max-content mixin also uses.
15
15
  --max-content-width: #{mixins.$max-content-width};
16
16
  --space-1: 4px;
17
17
  --space-2: 8px;
@@ -33,8 +33,8 @@
33
33
  )
34
34
  );
35
35
 
36
- // Modal chrome vars consumed by @greendrake/ui's Modal — part of the default
37
- // dashboard look (the dark-glass window over a dimmed backdrop).
36
+ // Modal chrome — part of the default dashboard look (the dark-glass window
37
+ // over a dimmed backdrop).
38
38
  :root {
39
39
  --modal-background: var(--background-color);
40
40
  --modal-box-shadow: rgba(255, 255, 255, 0.5) 0px 4px 25px;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@greendrake/theme",
3
- "version": "0.3.0",
3
+ "version": "0.5.0",
4
4
  "description": "Design tokens, document-level element styling, a light/dark theming mixin and an opt-in dashboard palette",
5
5
  "license": "MIT",
6
6
  "author": "Eugene Greendrake <eugene@greendrake.nz>",
@@ -54,10 +54,10 @@
54
54
  },
55
55
  "prettier": "@greendrake/dev-config/prettier",
56
56
  "dependencies": {
57
- "@greendrake/css-reset": "0.3.0",
58
- "@greendrake/scss-kit": "0.3.0"
57
+ "@greendrake/css-reset": "0.5.0",
58
+ "@greendrake/scss-kit": "0.5.0"
59
59
  },
60
60
  "devDependencies": {
61
- "@greendrake/dev-config": "0.3.0"
61
+ "@greendrake/dev-config": "0.5.0"
62
62
  }
63
63
  }