@widgetic/design-system 0.5.26 → 0.5.27

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.
@@ -21,10 +21,21 @@
21
21
  --color-alpha-dark-08: color-mix(in oklab, var(--color-dark) 8%, transparent);
22
22
  --color-alpha-dark-30: color-mix(in oklab, var(--color-dark) 30%, transparent);
23
23
  --color-alpha-light-10: color-mix(in oklab, var(--color-white) 10%, transparent);
24
+
25
+ /* The primitives that only the Dark mode uses (Figma Primitives collection, added together with the Dark mode of Color). */
26
+ --color-alpha-light-30: color-mix(in oklab, var(--color-white) 30%, transparent);
27
+ --color-alpha-light-70: color-mix(in oklab, var(--color-white) 70%, transparent);
28
+ --color-alpha-forest-40: color-mix(in oklab, var(--color-deep-forest-green) 40%, transparent);
29
+ --color-alpha-sage-15: color-mix(in oklab, var(--color-sage-green) 15%, transparent);
30
+ --color-alpha-sage-25: color-mix(in oklab, var(--color-sage-green) 25%, transparent);
31
+ /* status/error-light: the error red for the dark surface, 5.3:1 on it (the red of the light mode is 3.3:1). */
32
+ --color-error-light: #f55a5a;
33
+ /* status/warning-light: the warning amber for the dark surface, 10.2:1 on it (the amber of the light mode is 3.4:1). */
34
+ --color-amber-light: #fbbf24;
24
35
  }
25
36
 
26
37
  :root {
27
- /* Semantic colors (light mode). Add `.dark { ... }` when dark theme ships. */
38
+ /* Semantic colors (light mode). The Dark mode is the `.dark` block that follows this one. */
28
39
  --background: var(--color-white);
29
40
  --foreground: var(--color-dark);
30
41
  --card: var(--color-white);
@@ -119,6 +130,54 @@
119
130
  --shadow-floating: 0 4px 12px 0 var(--shadow-soft);
120
131
  }
121
132
 
133
+ /*
134
+ * The Dark mode of the Color collection (Figma file GCC2aXrh3PEHlMWFaAOisR, mode "Dark" of the collection "Color").
135
+ * Put `class="dark"` on the root element, or on any element that should be dark (the tokens inherit): the semantic
136
+ * colours below replace the ones of `:root` for it and everything inside it, and `dark:` utilities follow
137
+ * (tailwind.config.ts: darkMode "class"). Nothing in the package sets the class, so nothing changes until an app does.
138
+ *
139
+ * One token to one token with the Figma variables: the same semantic names, pointing at the same primitives.
140
+ * Figma gives brand/default, brand/foreground, shadow/soft and inverse/* the same primitive in both modes, so they are
141
+ * not repeated here: they keep the value of `:root`.
142
+ */
143
+ .dark {
144
+ color-scheme: dark;
145
+
146
+ --background: var(--color-dark);
147
+ --foreground: var(--color-white);
148
+ --card: var(--color-alpha-forest-40);
149
+ --card-foreground: var(--color-white);
150
+ --popover: var(--color-deep-forest-green);
151
+ --popover-foreground: var(--color-white);
152
+ --primary: var(--color-sage-green);
153
+ --primary-foreground: var(--color-dark);
154
+ --secondary: var(--color-alpha-light-10);
155
+ --secondary-foreground: var(--color-white);
156
+ --muted: var(--color-alpha-light-10);
157
+ --muted-foreground: var(--color-alpha-light-70);
158
+ --accent: var(--color-alpha-light-10);
159
+ --accent-foreground: var(--color-white);
160
+ /* Not a Figma variable, like --accent-hover of `:root`: the hover of a surface that is already accent, i.e. the accent
161
+ stacked on itself (white at 10% over white at 10% is about 20%). */
162
+ --accent-hover: color-mix(in oklab, var(--color-white) 20%, transparent);
163
+ --destructive: var(--color-error-light);
164
+ --destructive-foreground: var(--color-dark);
165
+ --warning: var(--color-amber-light);
166
+ --brand-subtle: var(--color-alpha-sage-15);
167
+ --border: var(--color-alpha-sage-25);
168
+ --border-strong: var(--color-alpha-light-30);
169
+ --input: var(--color-alpha-sage-25);
170
+ --ring: var(--color-sage-green);
171
+ --sidebar: var(--color-dark);
172
+ --sidebar-foreground: var(--color-white);
173
+ --sidebar-primary: var(--color-sage-green);
174
+ --sidebar-primary-foreground: var(--color-dark);
175
+ --sidebar-accent: var(--color-alpha-light-10);
176
+ --sidebar-accent-foreground: var(--color-white);
177
+ --sidebar-border: var(--color-alpha-sage-25);
178
+ --sidebar-ring: var(--color-sage-green);
179
+ }
180
+
122
181
  @theme inline {
123
182
  --color-background: var(--background);
124
183
  --color-foreground: var(--foreground);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@widgetic/design-system",
3
- "version": "0.5.26",
3
+ "version": "0.5.27",
4
4
  "license": "SEE LICENSE IN LICENSE",
5
5
  "type": "module",
6
6
  "svelte": "./dist/index.js",