@synopackageland/ui 0.14.11 → 0.15.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.
@@ -101,6 +101,42 @@ properties, for an app's own parts. The colour must be opaque `#rgb`,
101
101
  A light colour comes out darker than it went in: `#ffd400` becomes a deep
102
102
  amber, because a white label does not read on yellow.
103
103
 
104
+ In the dark theme, `AppRoot color-scheme="dark"` derives the accent with
105
+ `accentScale(color, { dark: true })`: step 9 and 10 are the same fills, so a
106
+ button keeps its white label; steps 1–8 are thicker tints laid on the dark
107
+ card (4–70%); steps 11 and 12 add white until they read at 4.5:1 and 7:1 on
108
+ step 3, so links and selected labels stay readable on a dark page.
109
+
110
+ ## Dark theme
111
+
112
+ The dark theme (`src/theme/dark.css`) ships inside `theme.css` and the embedded stylesheets. It applies wherever
113
+ `data-ui-color-scheme="dark"` is set: on the app root through
114
+ `<AppRoot color-scheme="dark">`, or on `<html>` for a full page (an app with
115
+ an accent still passes `color-scheme="dark"` to AppRoot, which derives the
116
+ accent for it). The library does not follow `prefers-color-scheme` by itself;
117
+ the host decides and sets the attribute.
118
+
119
+ The same roles, with the light page's sage carried into the greys:
120
+
121
+ | Role | Dark | |
122
+ | --- | --- | --- |
123
+ | `--ui-bg` | `#121513` | the page |
124
+ | `--ui-surface` | `#1b1f1c` | a card or panel |
125
+ | `--ui-surface-raised` | `#242925` | a menu or dialog |
126
+ | `--ui-text` | `#e3e8e4` | 13.4:1 on a card |
127
+ | `--ui-text-secondary` | 74% of the text | 7.9:1 on a card |
128
+ | `--ui-text-muted` | 50% of the text | |
129
+ | `--ui-border`, `-strong`, `-subtle` | mist at 16%, 26%, 9% | `rgba(200, 214, 204, …)` |
130
+ | `--ui-primary` | DSM blue `#057feb` | white label 4:1, as in light |
131
+ | `--ui-accent-11` | `#3597ef` | link text, 4.5:1 on step 3 |
132
+ | `--ui-info-text` … `--ui-danger-text` | `#7dbdf5`, `#6fdc8a`, `#f8bd84`, `#f59a9a` | 6.6:1 or more on their soft fill |
133
+ | `--ui-*-soft` | the tone at 18% | |
134
+
135
+ The tones' solid fills, radii, spacing and type are the light values. The
136
+ masks and shades (`--ui-overlay`, `--ui-drawer-backdrop`,
137
+ `--ui-scroll-edge-shade`), shadows, tooltip, scroll bar and switch thumb have
138
+ dark values too; a component draws no colour of its own outside these tokens.
139
+
104
140
  ## Lines and text
105
141
 
106
142
  `--ui-hairline` is 1px, and 0.5px (one device pixel) from 2dppx up. Menu
@@ -31,6 +31,7 @@ here stay implementation details and can change in any release.
31
31
  | --- | --- | --- |
32
32
  | `data-ui-app` | `AppRoot`'s root and its floating hosts (portals) | present |
33
33
  | `data-ui-theme`, `data-ui-density`, `data-ui-accent` | the app root (mirrored on floating hosts) | theme name, `compact`/`comfortable`, present |
34
+ | `data-ui-color-scheme` | the app root (AppRoot `color-scheme`, mirrored on floating hosts) or `<html>` | `dark` |
34
35
  | `data-ui-presentation` | `AppRoot` root | `mobile`, `window`, `web` |
35
36
  | `data-ui-floating` | a floating host (dialog, menu, popover) | present |
36
37
  | `data-ui-layout-mode` | `AppLayout` root | `mobile`, `window`, `web` |
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@synopackageland/ui",
3
- "version": "0.14.11",
3
+ "version": "0.15.0",
4
4
  "description": "Shared Vue 3 UI component library with a DSM 7 inspired application theme",
5
5
  "license": "MIT",
6
6
  "type": "module",