@firestitch/style 18.3.0 → 18.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/_variables.scss +30 -0
- package/package.json +1 -1
- package/styles/_form-controls.scss +108 -92
- package/styles/_form-field.scss +18 -13
- package/styles/_tokens.scss +172 -92
- package/styles/material.scss +5 -5
package/_variables.scss
CHANGED
|
@@ -7,6 +7,36 @@ $palette: mat.m2-define-palette(mat.$m2-blue-palette) !default;
|
|
|
7
7
|
/**
|
|
8
8
|
* Colors
|
|
9
9
|
*/
|
|
10
|
+
|
|
11
|
+
// THE APPLICATION'S BRAND, and the value behind --fs-color-primary: every
|
|
12
|
+
// @firestitch control that renders "primary" -- a checked checkbox, a selected
|
|
13
|
+
// radio, a slide toggle's track, a selected chip -- resolves to this.
|
|
14
|
+
//
|
|
15
|
+
// SET IT HERE, at the point every other knob is set:
|
|
16
|
+
//
|
|
17
|
+
// @use '@firestitch/style/variables' as fsVariables with (
|
|
18
|
+
// $primary-color: #005A9C
|
|
19
|
+
// );
|
|
20
|
+
//
|
|
21
|
+
// A CSS VARIABLE IS A VALID VALUE, and is how an app whose brand is chosen at
|
|
22
|
+
// RUNTIME wires this up -- a per-workspace brand, a theme setting, anything not
|
|
23
|
+
// known when the bundle is built:
|
|
24
|
+
//
|
|
25
|
+
// with ($primary-color: var(--my-brand-colour))
|
|
26
|
+
//
|
|
27
|
+
// Sass passes it through untouched and the browser resolves it at paint time,
|
|
28
|
+
// so the controls follow the brand with nothing to rebuild. The one thing that
|
|
29
|
+
// then does not work is Sass colour maths on this value (darken(), mix()): at
|
|
30
|
+
// build time it is an opaque string, not a colour. Nothing in this package does
|
|
31
|
+
// that to it, deliberately.
|
|
32
|
+
//
|
|
33
|
+
// LEAVING IT UNSET IS SUPPORTED and is why the default is a neutral slate
|
|
34
|
+
// rather than a brand: it reads on a light and a dark ground, so a package
|
|
35
|
+
// renders sensibly in an app that has configured nothing. It is NOT a colour
|
|
36
|
+
// any app should ship -- if a control is showing this teal, the app has a brand
|
|
37
|
+
// it never passed.
|
|
38
|
+
$primary-color: #1B474E !default;
|
|
39
|
+
|
|
10
40
|
$grey-color: #757575 !default;
|
|
11
41
|
$grey-dark-color: #696E74 !default;
|
|
12
42
|
$grey-light-color: #F2F2F2 !default;
|
package/package.json
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
@use '../variables';
|
|
2
|
+
|
|
1
3
|
// =============================================================================
|
|
2
4
|
// THE SELECTION CONTROLS
|
|
3
5
|
// =============================================================================
|
|
@@ -18,9 +20,23 @@
|
|
|
18
20
|
// computed-value time, so a CHECKED box renders unstyled rather than branded.
|
|
19
21
|
//
|
|
20
22
|
// Nothing here is app-specific. Every value is the shared --fs-* contract with
|
|
21
|
-
// this package's own
|
|
22
|
-
// nothing still renders, and an app that
|
|
23
|
-
//
|
|
23
|
+
// this package's own LIGHT default restated as the fallback, so an app that
|
|
24
|
+
// sets nothing still renders, and an app that configures $primary-color gets
|
|
25
|
+
// its brand for free.
|
|
26
|
+
//
|
|
27
|
+
// THE BRAND FALLBACK TRACKS THE KNOB, rather than repeating the literal it
|
|
28
|
+
// happens to default to: `var(--fs-color-primary, #{variables.$primary-color})`.
|
|
29
|
+
// An app that configured $primary-color and then somehow lost the token block
|
|
30
|
+
// still gets ITS colour here, not this package's neutral -- a fallback that
|
|
31
|
+
// contradicts the app's own configuration is worse than no fallback at all.
|
|
32
|
+
//
|
|
33
|
+
// THE FALLBACKS ARE THE LIGHT HALF - Ray 2026-09-16. They were the dark half,
|
|
34
|
+
// matching a contract that was dark-first until 18.2.2. A fallback fires only
|
|
35
|
+
// when the token is missing entirely - an app that has configured nothing,
|
|
36
|
+
// which by definition has a white page - so the dark half was the wrong value
|
|
37
|
+
// for precisely the case a fallback exists to serve: it painted near-white ink
|
|
38
|
+
// and near-white outlines onto white. See _tokens.scss for why the whole
|
|
39
|
+
// contract inverted.
|
|
24
40
|
//
|
|
25
41
|
// THE FALLBACKS ARE PLAIN LITERALS, NEVER light-dark() - 18.2.1. They were
|
|
26
42
|
// light-dark() pairs, and esbuild does not merely downlevel those on a host
|
|
@@ -73,52 +89,52 @@
|
|
|
73
89
|
// pick for its dividers. --fs-color-text-muted is the token that means
|
|
74
90
|
// "visible but secondary", which is the job, and it lands near Material's
|
|
75
91
|
// own default (0.54) rather than under it.
|
|
76
|
-
--mat-checkbox-unselected-icon-color: var(--fs-color-text-muted,
|
|
77
|
-
--mat-checkbox-unselected-hover-icon-color: var(--fs-color-text-muted,
|
|
78
|
-
--mat-checkbox-unselected-focus-icon-color: var(--fs-color-text-muted,
|
|
79
|
-
--mat-checkbox-unselected-pressed-icon-color: var(--fs-color-text-muted,
|
|
92
|
+
--mat-checkbox-unselected-icon-color: var(--fs-color-text-muted, rgba(0, 0, 0, 0.54));
|
|
93
|
+
--mat-checkbox-unselected-hover-icon-color: var(--fs-color-text-muted, rgba(0, 0, 0, 0.54));
|
|
94
|
+
--mat-checkbox-unselected-focus-icon-color: var(--fs-color-text-muted, rgba(0, 0, 0, 0.54));
|
|
95
|
+
--mat-checkbox-unselected-pressed-icon-color: var(--fs-color-text-muted, rgba(0, 0, 0, 0.54));
|
|
80
96
|
|
|
81
97
|
// Checked: the brand fills the box and the checkmark sits on it. The
|
|
82
98
|
// checkmark reads the SURFACE colour rather than white, so it stays legible
|
|
83
99
|
// if an app maps --fs-color-primary to a pale brand.
|
|
84
|
-
--mat-checkbox-selected-icon-color: var(--fs-color-primary, #
|
|
85
|
-
--mat-checkbox-selected-hover-icon-color: var(--fs-color-primary, #
|
|
86
|
-
--mat-checkbox-selected-focus-icon-color: var(--fs-color-primary, #
|
|
87
|
-
--mat-checkbox-selected-checkmark-color: var(--fs-surface-background, #
|
|
100
|
+
--mat-checkbox-selected-icon-color: var(--fs-color-primary, #{variables.$primary-color});
|
|
101
|
+
--mat-checkbox-selected-hover-icon-color: var(--fs-color-primary, #{variables.$primary-color});
|
|
102
|
+
--mat-checkbox-selected-focus-icon-color: var(--fs-color-primary, #{variables.$primary-color});
|
|
103
|
+
--mat-checkbox-selected-checkmark-color: var(--fs-surface-background, #FFFFFF);
|
|
88
104
|
|
|
89
|
-
--mat-checkbox-label-text-color: var(--fs-color-text,
|
|
90
|
-
--mat-checkbox-disabled-label-color: var(--fs-color-text-faint,
|
|
91
|
-
--mat-checkbox-disabled-unselected-icon-color: var(--fs-hairline,
|
|
92
|
-
--mat-checkbox-disabled-selected-icon-color: var(--fs-hairline-strong, rgba(
|
|
105
|
+
--mat-checkbox-label-text-color: var(--fs-color-text, rgba(0, 0, 0, 0.87));
|
|
106
|
+
--mat-checkbox-disabled-label-color: var(--fs-color-text-faint, rgba(0, 0, 0, 0.38));
|
|
107
|
+
--mat-checkbox-disabled-unselected-icon-color: var(--fs-hairline, #f0f0f0);
|
|
108
|
+
--mat-checkbox-disabled-selected-icon-color: var(--fs-hairline-strong, rgba(0, 0, 0, 0.38));
|
|
93
109
|
|
|
94
110
|
// The wash under a hover or press. Translucent, never a fixed grey: it takes
|
|
95
111
|
// its tone from whatever is behind it and so reads in both schemes.
|
|
96
|
-
--mat-checkbox-unselected-hover-state-layer-color: var(--fs-color-hover, rgba(
|
|
97
|
-
--mat-checkbox-unselected-pressed-state-layer-color: var(--fs-color-hover, rgba(
|
|
98
|
-
--mat-checkbox-selected-hover-state-layer-color: var(--fs-color-selected, rgba(
|
|
99
|
-
--mat-checkbox-selected-pressed-state-layer-color: var(--fs-color-selected, rgba(
|
|
112
|
+
--mat-checkbox-unselected-hover-state-layer-color: var(--fs-color-hover, rgba(0, 0, 0, 0.04));
|
|
113
|
+
--mat-checkbox-unselected-pressed-state-layer-color: var(--fs-color-hover, rgba(0, 0, 0, 0.04));
|
|
114
|
+
--mat-checkbox-selected-hover-state-layer-color: var(--fs-color-selected, rgba(0, 0, 0, 0.08));
|
|
115
|
+
--mat-checkbox-selected-pressed-state-layer-color: var(--fs-color-selected, rgba(0, 0, 0, 0.08));
|
|
100
116
|
|
|
101
117
|
// =========================================================================
|
|
102
118
|
// RADIO
|
|
103
119
|
// =========================================================================
|
|
104
120
|
// Same three questions as the checkbox, same answers - the two controls
|
|
105
121
|
// differ in shape and in whether they are exclusive, never in colour.
|
|
106
|
-
--mat-radio-unselected-icon-color: var(--fs-color-text-muted,
|
|
107
|
-
--mat-radio-unselected-hover-icon-color: var(--fs-color-text-muted,
|
|
108
|
-
--mat-radio-unselected-focus-icon-color: var(--fs-color-text-muted,
|
|
109
|
-
--mat-radio-unselected-pressed-icon-color: var(--fs-color-text-muted,
|
|
122
|
+
--mat-radio-unselected-icon-color: var(--fs-color-text-muted, rgba(0, 0, 0, 0.54));
|
|
123
|
+
--mat-radio-unselected-hover-icon-color: var(--fs-color-text-muted, rgba(0, 0, 0, 0.54));
|
|
124
|
+
--mat-radio-unselected-focus-icon-color: var(--fs-color-text-muted, rgba(0, 0, 0, 0.54));
|
|
125
|
+
--mat-radio-unselected-pressed-icon-color: var(--fs-color-text-muted, rgba(0, 0, 0, 0.54));
|
|
110
126
|
|
|
111
|
-
--mat-radio-selected-icon-color: var(--fs-color-primary, #
|
|
112
|
-
--mat-radio-selected-hover-icon-color: var(--fs-color-primary, #
|
|
113
|
-
--mat-radio-selected-focus-icon-color: var(--fs-color-primary, #
|
|
114
|
-
--mat-radio-selected-pressed-icon-color: var(--fs-color-primary, #
|
|
127
|
+
--mat-radio-selected-icon-color: var(--fs-color-primary, #{variables.$primary-color});
|
|
128
|
+
--mat-radio-selected-hover-icon-color: var(--fs-color-primary, #{variables.$primary-color});
|
|
129
|
+
--mat-radio-selected-focus-icon-color: var(--fs-color-primary, #{variables.$primary-color});
|
|
130
|
+
--mat-radio-selected-pressed-icon-color: var(--fs-color-primary, #{variables.$primary-color});
|
|
115
131
|
|
|
116
|
-
--mat-radio-label-text-color: var(--fs-color-text,
|
|
117
|
-
--mat-radio-disabled-label-color: var(--fs-color-text-faint,
|
|
118
|
-
--mat-radio-disabled-unselected-icon-color: var(--fs-hairline,
|
|
119
|
-
--mat-radio-disabled-selected-icon-color: var(--fs-hairline-strong, rgba(
|
|
120
|
-
--mat-radio-ripple-color: var(--fs-color-hover, rgba(
|
|
121
|
-
--mat-radio-checked-ripple-color: var(--fs-color-selected, rgba(
|
|
132
|
+
--mat-radio-label-text-color: var(--fs-color-text, rgba(0, 0, 0, 0.87));
|
|
133
|
+
--mat-radio-disabled-label-color: var(--fs-color-text-faint, rgba(0, 0, 0, 0.38));
|
|
134
|
+
--mat-radio-disabled-unselected-icon-color: var(--fs-hairline, #f0f0f0);
|
|
135
|
+
--mat-radio-disabled-selected-icon-color: var(--fs-hairline-strong, rgba(0, 0, 0, 0.38));
|
|
136
|
+
--mat-radio-ripple-color: var(--fs-color-hover, rgba(0, 0, 0, 0.04));
|
|
137
|
+
--mat-radio-checked-ripple-color: var(--fs-color-selected, rgba(0, 0, 0, 0.08));
|
|
122
138
|
|
|
123
139
|
// =========================================================================
|
|
124
140
|
// SLIDE TOGGLE
|
|
@@ -126,35 +142,35 @@
|
|
|
126
142
|
// The toggle is a TRACK with a HANDLE on it, so "unselected" is two colours
|
|
127
143
|
// rather than one: the track is the hairline it sits in, and the handle is
|
|
128
144
|
// the muted ink so it reads as an object on that track rather than a hole.
|
|
129
|
-
--mat-slide-toggle-unselected-track-color: var(--fs-hairline,
|
|
130
|
-
--mat-slide-toggle-unselected-hover-track-color: var(--fs-hairline,
|
|
131
|
-
--mat-slide-toggle-unselected-focus-track-color: var(--fs-hairline,
|
|
132
|
-
--mat-slide-toggle-unselected-pressed-track-color: var(--fs-hairline,
|
|
133
|
-
--mat-slide-toggle-unselected-handle-color: var(--fs-color-text-muted,
|
|
134
|
-
--mat-slide-toggle-unselected-hover-handle-color: var(--fs-color-text,
|
|
135
|
-
--mat-slide-toggle-unselected-focus-handle-color: var(--fs-color-text,
|
|
136
|
-
--mat-slide-toggle-unselected-pressed-handle-color: var(--fs-color-text,
|
|
137
|
-
--mat-slide-toggle-unselected-icon-color: var(--fs-surface-background, #
|
|
145
|
+
--mat-slide-toggle-unselected-track-color: var(--fs-hairline, #f0f0f0);
|
|
146
|
+
--mat-slide-toggle-unselected-hover-track-color: var(--fs-hairline, #f0f0f0);
|
|
147
|
+
--mat-slide-toggle-unselected-focus-track-color: var(--fs-hairline, #f0f0f0);
|
|
148
|
+
--mat-slide-toggle-unselected-pressed-track-color: var(--fs-hairline, #f0f0f0);
|
|
149
|
+
--mat-slide-toggle-unselected-handle-color: var(--fs-color-text-muted, rgba(0, 0, 0, 0.54));
|
|
150
|
+
--mat-slide-toggle-unselected-hover-handle-color: var(--fs-color-text, rgba(0, 0, 0, 0.87));
|
|
151
|
+
--mat-slide-toggle-unselected-focus-handle-color: var(--fs-color-text, rgba(0, 0, 0, 0.87));
|
|
152
|
+
--mat-slide-toggle-unselected-pressed-handle-color: var(--fs-color-text, rgba(0, 0, 0, 0.87));
|
|
153
|
+
--mat-slide-toggle-unselected-icon-color: var(--fs-surface-background, #FFFFFF);
|
|
138
154
|
|
|
139
155
|
// Selected: the brand fills the track, and the handle goes to the surface
|
|
140
156
|
// colour so it reads as a light knob on a coloured rail in both schemes.
|
|
141
|
-
--mat-slide-toggle-selected-track-color: var(--fs-color-primary, #
|
|
142
|
-
--mat-slide-toggle-selected-hover-track-color: var(--fs-color-primary, #
|
|
143
|
-
--mat-slide-toggle-selected-focus-track-color: var(--fs-color-primary, #
|
|
144
|
-
--mat-slide-toggle-selected-pressed-track-color: var(--fs-color-primary, #
|
|
145
|
-
--mat-slide-toggle-selected-handle-color: var(--fs-surface-background, #
|
|
146
|
-
--mat-slide-toggle-selected-hover-handle-color: var(--fs-surface-background, #
|
|
147
|
-
--mat-slide-toggle-selected-focus-handle-color: var(--fs-surface-background, #
|
|
148
|
-
--mat-slide-toggle-selected-pressed-handle-color: var(--fs-surface-background, #
|
|
149
|
-
--mat-slide-toggle-selected-icon-color: var(--fs-color-primary, #
|
|
157
|
+
--mat-slide-toggle-selected-track-color: var(--fs-color-primary, #{variables.$primary-color});
|
|
158
|
+
--mat-slide-toggle-selected-hover-track-color: var(--fs-color-primary, #{variables.$primary-color});
|
|
159
|
+
--mat-slide-toggle-selected-focus-track-color: var(--fs-color-primary, #{variables.$primary-color});
|
|
160
|
+
--mat-slide-toggle-selected-pressed-track-color: var(--fs-color-primary, #{variables.$primary-color});
|
|
161
|
+
--mat-slide-toggle-selected-handle-color: var(--fs-surface-background, #FFFFFF);
|
|
162
|
+
--mat-slide-toggle-selected-hover-handle-color: var(--fs-surface-background, #FFFFFF);
|
|
163
|
+
--mat-slide-toggle-selected-focus-handle-color: var(--fs-surface-background, #FFFFFF);
|
|
164
|
+
--mat-slide-toggle-selected-pressed-handle-color: var(--fs-surface-background, #FFFFFF);
|
|
165
|
+
--mat-slide-toggle-selected-icon-color: var(--fs-color-primary, #{variables.$primary-color});
|
|
150
166
|
|
|
151
|
-
--mat-slide-toggle-label-text-color: var(--fs-color-text,
|
|
152
|
-
--mat-slide-toggle-disabled-label-text-color: var(--fs-color-text-faint,
|
|
153
|
-
--mat-slide-toggle-disabled-unselected-track-outline-color: var(--fs-hairline,
|
|
154
|
-
--mat-slide-toggle-selected-focus-state-layer-color: var(--fs-color-selected, rgba(
|
|
155
|
-
--mat-slide-toggle-selected-hover-state-layer-color: var(--fs-color-selected, rgba(
|
|
156
|
-
--mat-slide-toggle-unselected-focus-state-layer-color: var(--fs-color-hover, rgba(
|
|
157
|
-
--mat-slide-toggle-unselected-hover-state-layer-color: var(--fs-color-hover, rgba(
|
|
167
|
+
--mat-slide-toggle-label-text-color: var(--fs-color-text, rgba(0, 0, 0, 0.87));
|
|
168
|
+
--mat-slide-toggle-disabled-label-text-color: var(--fs-color-text-faint, rgba(0, 0, 0, 0.38));
|
|
169
|
+
--mat-slide-toggle-disabled-unselected-track-outline-color: var(--fs-hairline, #f0f0f0);
|
|
170
|
+
--mat-slide-toggle-selected-focus-state-layer-color: var(--fs-color-selected, rgba(0, 0, 0, 0.08));
|
|
171
|
+
--mat-slide-toggle-selected-hover-state-layer-color: var(--fs-color-selected, rgba(0, 0, 0, 0.08));
|
|
172
|
+
--mat-slide-toggle-unselected-focus-state-layer-color: var(--fs-color-hover, rgba(0, 0, 0, 0.04));
|
|
173
|
+
--mat-slide-toggle-unselected-hover-state-layer-color: var(--fs-color-hover, rgba(0, 0, 0, 0.04));
|
|
158
174
|
|
|
159
175
|
// =========================================================================
|
|
160
176
|
// SLIDER
|
|
@@ -162,22 +178,22 @@
|
|
|
162
178
|
// The ACTIVE track is the brand, the INACTIVE track is the hairline, and the
|
|
163
179
|
// handle matches the active track rather than the surface - a slider's knob
|
|
164
180
|
// is part of the value it is showing.
|
|
165
|
-
--mat-slider-active-track-color: var(--fs-color-primary, #
|
|
166
|
-
--mat-slider-inactive-track-color: var(--fs-hairline-strong, rgba(
|
|
167
|
-
--mat-slider-handle-color: var(--fs-color-primary, #
|
|
168
|
-
--mat-slider-hover-handle-color: var(--fs-color-primary, #
|
|
169
|
-
--mat-slider-focus-handle-color: var(--fs-color-primary, #
|
|
170
|
-
--mat-slider-disabled-active-track-color: var(--fs-hairline-strong, rgba(
|
|
171
|
-
--mat-slider-disabled-inactive-track-color: var(--fs-hairline,
|
|
172
|
-
--mat-slider-disabled-handle-color: var(--fs-hairline-strong, rgba(
|
|
173
|
-
--mat-slider-ripple-color: var(--fs-color-selected, rgba(
|
|
174
|
-
--mat-slider-hover-state-layer-color: var(--fs-color-hover, rgba(
|
|
175
|
-
--mat-slider-focus-state-layer-color: var(--fs-color-selected, rgba(
|
|
181
|
+
--mat-slider-active-track-color: var(--fs-color-primary, #{variables.$primary-color});
|
|
182
|
+
--mat-slider-inactive-track-color: var(--fs-hairline-strong, rgba(0, 0, 0, 0.38));
|
|
183
|
+
--mat-slider-handle-color: var(--fs-color-primary, #{variables.$primary-color});
|
|
184
|
+
--mat-slider-hover-handle-color: var(--fs-color-primary, #{variables.$primary-color});
|
|
185
|
+
--mat-slider-focus-handle-color: var(--fs-color-primary, #{variables.$primary-color});
|
|
186
|
+
--mat-slider-disabled-active-track-color: var(--fs-hairline-strong, rgba(0, 0, 0, 0.38));
|
|
187
|
+
--mat-slider-disabled-inactive-track-color: var(--fs-hairline, #f0f0f0);
|
|
188
|
+
--mat-slider-disabled-handle-color: var(--fs-hairline-strong, rgba(0, 0, 0, 0.38));
|
|
189
|
+
--mat-slider-ripple-color: var(--fs-color-selected, rgba(0, 0, 0, 0.08));
|
|
190
|
+
--mat-slider-hover-state-layer-color: var(--fs-color-hover, rgba(0, 0, 0, 0.04));
|
|
191
|
+
--mat-slider-focus-state-layer-color: var(--fs-color-selected, rgba(0, 0, 0, 0.08));
|
|
176
192
|
|
|
177
193
|
// The value bubble is a floating surface, so it takes the RAISED surface and
|
|
178
194
|
// the ink that reads on it.
|
|
179
|
-
--mat-slider-label-container-color: var(--fs-surface-background, #
|
|
180
|
-
--mat-slider-label-label-text-color: var(--fs-color-text,
|
|
195
|
+
--mat-slider-label-container-color: var(--fs-surface-background, #FFFFFF);
|
|
196
|
+
--mat-slider-label-label-text-color: var(--fs-color-text, rgba(0, 0, 0, 0.87));
|
|
181
197
|
|
|
182
198
|
// =========================================================================
|
|
183
199
|
// CHIP
|
|
@@ -185,21 +201,21 @@
|
|
|
185
201
|
// A chip is a SURFACE with a label, not an outline with a tint, so the flat
|
|
186
202
|
// (unselected) chip takes the hover wash rather than the page ground - that
|
|
187
203
|
// is what separates it from whatever it sits on without a border.
|
|
188
|
-
--mat-chip-elevated-container-color: var(--fs-color-hover, rgba(
|
|
189
|
-
--mat-chip-label-text-color: var(--fs-color-text,
|
|
190
|
-
--mat-chip-outline-color: var(--fs-hairline-strong, rgba(
|
|
191
|
-
--mat-chip-focus-outline-color: var(--fs-color-primary, #
|
|
204
|
+
--mat-chip-elevated-container-color: var(--fs-color-hover, rgba(0, 0, 0, 0.04));
|
|
205
|
+
--mat-chip-label-text-color: var(--fs-color-text, rgba(0, 0, 0, 0.87));
|
|
206
|
+
--mat-chip-outline-color: var(--fs-hairline-strong, rgba(0, 0, 0, 0.38));
|
|
207
|
+
--mat-chip-focus-outline-color: var(--fs-color-primary, #{variables.$primary-color});
|
|
192
208
|
|
|
193
|
-
--mat-chip-elevated-selected-container-color: var(--fs-color-primary, #
|
|
194
|
-
--mat-chip-selected-label-text-color: var(--fs-surface-background, #
|
|
195
|
-
--mat-chip-selected-trailing-icon-color: var(--fs-surface-background, #
|
|
209
|
+
--mat-chip-elevated-selected-container-color: var(--fs-color-primary, #{variables.$primary-color});
|
|
210
|
+
--mat-chip-selected-label-text-color: var(--fs-surface-background, #FFFFFF);
|
|
211
|
+
--mat-chip-selected-trailing-icon-color: var(--fs-surface-background, #FFFFFF);
|
|
196
212
|
|
|
197
|
-
--mat-chip-disabled-label-text-color: var(--fs-color-text-faint,
|
|
198
|
-
--mat-chip-disabled-outline-color: var(--fs-hairline,
|
|
199
|
-
--mat-chip-hover-state-layer-color: var(--fs-color-hover, rgba(
|
|
200
|
-
--mat-chip-focus-state-layer-color: var(--fs-color-selected, rgba(
|
|
201
|
-
--mat-chip-selected-hover-state-layer-color: var(--fs-color-selected, rgba(
|
|
202
|
-
--mat-chip-selected-focus-state-layer-color: var(--fs-color-selected, rgba(
|
|
213
|
+
--mat-chip-disabled-label-text-color: var(--fs-color-text-faint, rgba(0, 0, 0, 0.38));
|
|
214
|
+
--mat-chip-disabled-outline-color: var(--fs-hairline, #f0f0f0);
|
|
215
|
+
--mat-chip-hover-state-layer-color: var(--fs-color-hover, rgba(0, 0, 0, 0.04));
|
|
216
|
+
--mat-chip-focus-state-layer-color: var(--fs-color-selected, rgba(0, 0, 0, 0.08));
|
|
217
|
+
--mat-chip-selected-hover-state-layer-color: var(--fs-color-selected, rgba(0, 0, 0, 0.08));
|
|
218
|
+
--mat-chip-selected-focus-state-layer-color: var(--fs-color-selected, rgba(0, 0, 0, 0.08));
|
|
203
219
|
|
|
204
220
|
// =========================================================================
|
|
205
221
|
// PSEUDO-CHECKBOX
|
|
@@ -218,18 +234,18 @@
|
|
|
218
234
|
// FULL is the variant that draws a box; MINIMAL draws only a checkmark with
|
|
219
235
|
// no container. Both are themed: an app choosing either gets a control that
|
|
220
236
|
// reads, and the two never disagree about what "selected" looks like.
|
|
221
|
-
--mat-pseudo-checkbox-full-unselected-icon-color: var(--fs-color-text-muted,
|
|
222
|
-
--mat-pseudo-checkbox-full-selected-icon-color: var(--fs-color-primary, #
|
|
223
|
-
--mat-pseudo-checkbox-full-selected-checkmark-color: var(--fs-surface-background, #
|
|
237
|
+
--mat-pseudo-checkbox-full-unselected-icon-color: var(--fs-color-text-muted, rgba(0, 0, 0, 0.54));
|
|
238
|
+
--mat-pseudo-checkbox-full-selected-icon-color: var(--fs-color-primary, #{variables.$primary-color});
|
|
239
|
+
--mat-pseudo-checkbox-full-selected-checkmark-color: var(--fs-surface-background, #FFFFFF);
|
|
224
240
|
|
|
225
|
-
--mat-pseudo-checkbox-full-disabled-unselected-icon-color: var(--fs-hairline,
|
|
226
|
-
--mat-pseudo-checkbox-full-disabled-selected-icon-color: var(--fs-hairline-strong, rgba(
|
|
227
|
-
--mat-pseudo-checkbox-full-disabled-selected-checkmark-color: var(--fs-surface-background, #
|
|
241
|
+
--mat-pseudo-checkbox-full-disabled-unselected-icon-color: var(--fs-hairline, #f0f0f0);
|
|
242
|
+
--mat-pseudo-checkbox-full-disabled-selected-icon-color: var(--fs-hairline-strong, rgba(0, 0, 0, 0.38));
|
|
243
|
+
--mat-pseudo-checkbox-full-disabled-selected-checkmark-color: var(--fs-surface-background, #FFFFFF);
|
|
228
244
|
|
|
229
245
|
// The minimal variant has no box to fill, so the CHECKMARK carries the
|
|
230
246
|
// brand rather than sitting on it - the inverse of the full variant above.
|
|
231
|
-
--mat-pseudo-checkbox-minimal-selected-checkmark-color: var(--fs-color-primary, #
|
|
232
|
-
--mat-pseudo-checkbox-minimal-disabled-selected-checkmark-color: var(--fs-color-text-faint,
|
|
247
|
+
--mat-pseudo-checkbox-minimal-selected-checkmark-color: var(--fs-color-primary, #{variables.$primary-color});
|
|
248
|
+
--mat-pseudo-checkbox-minimal-disabled-selected-checkmark-color: var(--fs-color-text-faint, rgba(0, 0, 0, 0.38));
|
|
233
249
|
}
|
|
234
250
|
|
|
235
251
|
// ===========================================================================
|
package/styles/_form-field.scss
CHANGED
|
@@ -49,14 +49,18 @@
|
|
|
49
49
|
// So a host app could not correct these from outside; they had to be fixed
|
|
50
50
|
// here.
|
|
51
51
|
//
|
|
52
|
-
//
|
|
53
|
-
//
|
|
54
|
-
//
|
|
55
|
-
//
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
52
|
+
// THE FALLBACK IS THE LIGHT VALUE -- Ray 2026-09-16. It was #232428, the
|
|
53
|
+
// dark surface, which is what put a black interior in every input in an app
|
|
54
|
+
// that had set no theme marker at all. A field's ground is the single most
|
|
55
|
+
// visible thing this package paints, so it is also the place a dark-first
|
|
56
|
+
// default did the most damage: an unconfigured app got black boxes on a
|
|
57
|
+
// white page. The token still flips for an app that marks itself dark; only
|
|
58
|
+
// the no-token-at-all case changed, and it now matches the white page such
|
|
59
|
+
// an app actually has.
|
|
60
|
+
--mdc-filled-text-field-container-color: var(--fs-surface-background, #FFFFFF);
|
|
61
|
+
--mdc-filled-text-field-disabled-container-color: var(--fs-color-hover, rgba(0, 0, 0, 0.04));
|
|
62
|
+
--mat-form-field-filled-container-color: var(--fs-surface-background, #FFFFFF);
|
|
63
|
+
--mat-form-field-filled-disabled-container-color: var(--fs-color-hover, rgba(0, 0, 0, 0.04));
|
|
60
64
|
|
|
61
65
|
.mat-mdc-text-field-wrapper {
|
|
62
66
|
border: 1px solid var(--mdc-outlined-text-field-outline-color, var(--mat-form-field-outlined-outline-color, rgb(127 127 127 / 38%)));
|
|
@@ -73,10 +77,11 @@
|
|
|
73
77
|
|
|
74
78
|
&:hover:not(.mat-focused):not(.mat-form-field-invalid):not(.mat-form-field-disabled) {
|
|
75
79
|
.mat-mdc-text-field-wrapper {
|
|
76
|
-
// The last-resort fallback
|
|
77
|
-
//
|
|
78
|
-
//
|
|
79
|
-
|
|
80
|
+
// The last-resort fallback renders when @firestitch/style's material
|
|
81
|
+
// layer is absent -- an unconfigured host, which has a white page, so
|
|
82
|
+
// it takes the light ink rather than the near-white #E8EDEC that used
|
|
83
|
+
// to sit here and left the hover border invisible on white.
|
|
84
|
+
border-color: var(--mdc-outlined-text-field-hover-outline-color, var(--mat-form-field-outlined-hover-outline-color, rgba(0, 0, 0, 0.87)));
|
|
80
85
|
}
|
|
81
86
|
}
|
|
82
87
|
|
|
@@ -109,7 +114,7 @@
|
|
|
109
114
|
}
|
|
110
115
|
|
|
111
116
|
&.mat-form-field-disabled .mat-mdc-text-field-wrapper {
|
|
112
|
-
border-color: var(--mdc-outlined-text-field-disabled-outline-color, var(--mat-form-field-outlined-disabled-outline-color, rgba(
|
|
117
|
+
border-color: var(--mdc-outlined-text-field-disabled-outline-color, var(--mat-form-field-outlined-disabled-outline-color, rgba(0, 0, 0, 0.12)));
|
|
113
118
|
}
|
|
114
119
|
}
|
|
115
120
|
|
package/styles/_tokens.scss
CHANGED
|
@@ -1,36 +1,59 @@
|
|
|
1
|
+
@use '../variables';
|
|
2
|
+
|
|
1
3
|
// =============================================================================
|
|
2
4
|
// THE SHARED COLOUR CONTRACT
|
|
3
5
|
// =============================================================================
|
|
4
6
|
// The names every @firestitch package reads instead of hardcoding a hex.
|
|
5
7
|
//
|
|
6
|
-
//
|
|
7
|
-
// on :root, and a second block restates the
|
|
8
|
-
// itself
|
|
8
|
+
// LIGHT IS THE BASE; DARK IS AN OPT-IN. The light values are declared plainly
|
|
9
|
+
// on :root, and a second block restates the dark ones when the host marks
|
|
10
|
+
// itself dark. No light-dark() in any declaration here — read on.
|
|
11
|
+
//
|
|
12
|
+
// WHY LIGHT IS THE BASE — Ray 2026-09-16. This file was dark-first until
|
|
13
|
+
// 18.2.2, on the reasoning that a dark token on a light page merely reads heavy
|
|
14
|
+
// while a light token on a dark page vanishes, so failing toward "too strong"
|
|
15
|
+
// was the safer default. That reasoning was about which FAILURE is uglier, and
|
|
16
|
+
// it answered the wrong question. The right one is which failure is more
|
|
17
|
+
// LIKELY, and dark-first got that exactly backwards:
|
|
18
|
+
//
|
|
19
|
+
// - An app that has configured nothing has a WHITE page. That is Material's
|
|
20
|
+
// default, the browser's default and every one of these apps' actual
|
|
21
|
+
// ground. Dark-first meant such an app got #232428 field interiors, a
|
|
22
|
+
// #E8EDEC hairline and near-white ink on white — not "heavy", unreadable.
|
|
23
|
+
// - Marking the page dark is a deliberate act. An app dark enough to need
|
|
24
|
+
// dark tokens has already built a theme switch, so asking it for one more
|
|
25
|
+
// marker costs nothing. An app that never thought about theming at all is
|
|
26
|
+
// the one that must not have to.
|
|
27
|
+
//
|
|
28
|
+
// So the default is now the configuration nobody has to make, and the override
|
|
29
|
+
// is the one an app has already decided it wants. Specify shipped with neither
|
|
30
|
+
// marker set and rendered dark on white — that is the bug this inversion ends.
|
|
9
31
|
//
|
|
10
32
|
// WHY NOT light-dark(), WHICH THIS FILE USED UNTIL 18.2.0. It was the right
|
|
11
33
|
// idea and it does not survive the build. light-dark() needs Chrome 123+, and
|
|
12
34
|
// a host whose browserslist still includes an older engine gets it DOWNLEVELLED
|
|
13
35
|
// by esbuild — flattened to its LIGHT half, unconditionally. The failure is
|
|
14
|
-
// silent and total
|
|
15
|
-
//
|
|
16
|
-
// panel, invisible. Nothing warns, the source file looks correct, and the
|
|
17
|
-
// served CSS is the only place the truth shows.
|
|
36
|
+
// silent and total, and the source file looks correct either way; the served
|
|
37
|
+
// CSS is the only place the truth shows.
|
|
18
38
|
//
|
|
19
39
|
// That is not a browser-support question a shared package gets to have an
|
|
20
40
|
// opinion about. A host app chooses its own browserslist for its own reasons,
|
|
21
41
|
// and a colour contract that quietly inverts on some of those choices is
|
|
22
42
|
// broken, not merely modern.
|
|
23
43
|
//
|
|
24
|
-
// HOW A HOST SAYS "
|
|
25
|
-
// already sets one:
|
|
44
|
+
// HOW A HOST SAYS "DARK". Either marker works:
|
|
26
45
|
//
|
|
27
|
-
// <html class="theme-
|
|
46
|
+
// <html class="theme-dark"> or <html data-theme="dark">
|
|
28
47
|
//
|
|
29
|
-
// A host that marks nothing gets the
|
|
30
|
-
//
|
|
31
|
-
//
|
|
32
|
-
//
|
|
33
|
-
//
|
|
48
|
+
// A host that marks nothing gets the light values.
|
|
49
|
+
//
|
|
50
|
+
// .theme-light AND [data-theme="light"] ARE STILL HONOURED, as a no-op that
|
|
51
|
+
// restates the base. Apps already set them — CloudCure's ThemeService does —
|
|
52
|
+
// and under a light-first base they would otherwise be a selector matching
|
|
53
|
+
// nothing, which reads as broken to anyone who greps for it. Restating makes
|
|
54
|
+
// them explicit and keeps an app that toggles BETWEEN the two markers correct:
|
|
55
|
+
// switching from .theme-dark to .theme-light must actively restore the light
|
|
56
|
+
// values, not merely stop applying the dark ones.
|
|
34
57
|
//
|
|
35
58
|
// STILL DECLARED, NOT DETECTED. Nothing here reads prefers-color-scheme. That
|
|
36
59
|
// media query reports the DEVICE, and an app whose user chose Light on a dark
|
|
@@ -39,68 +62,86 @@
|
|
|
39
62
|
//
|
|
40
63
|
// KEEP DECLARING color-scheme TOO. It is what paints the browser's own chrome —
|
|
41
64
|
// caret, scrollbars, autofill, native control internals — which no custom
|
|
42
|
-
// property can reach. It
|
|
43
|
-
// redundant.
|
|
65
|
+
// property can reach. It does not drive these tokens, but it is not redundant.
|
|
44
66
|
//
|
|
45
67
|
// EVERY CONSUMER KEEPS ITS OWN FALLBACK, AS A PLAIN LITERAL. A package reads
|
|
46
|
-
// these as `var(--fs-hairline,
|
|
47
|
-
// @firestitch/style is not installed at all.
|
|
68
|
+
// these as `var(--fs-hairline, #f0f0f0)` so it still renders when
|
|
69
|
+
// @firestitch/style is not installed at all. Those fallbacks are now the LIGHT
|
|
70
|
+
// half, matching this base — a package with no style package present is by
|
|
71
|
+
// definition an unconfigured host, which is the case light-first exists for.
|
|
48
72
|
//
|
|
49
73
|
// NEVER light-dark() IN A FALLBACK. Given `var(--name, light-dark(A, B))`,
|
|
50
74
|
// esbuild does not just downlevel the inner function — it folds the WHOLE
|
|
51
75
|
// expression to the literal A and throws the var() reference away. The consumer
|
|
52
76
|
// then never reads the token, so correcting the token's value changes nothing
|
|
53
77
|
// on screen. That is why three published versions in a row fixed nothing: the
|
|
54
|
-
// source read correctly every time and the served CSS carried a bare
|
|
55
|
-
//
|
|
78
|
+
// source read correctly every time and the served CSS carried a bare literal
|
|
79
|
+
// where a var() should have been.
|
|
56
80
|
//
|
|
57
81
|
// A fallback covers the case where this block never loaded, which is a
|
|
58
|
-
// single-value situation by definition. One literal, the
|
|
82
|
+
// single-value situation by definition. One literal, the light one.
|
|
59
83
|
//
|
|
60
84
|
// These are CSS custom properties, not Sass variables, on purpose: they resolve
|
|
61
85
|
// in the browser at paint time, so one declaration re-skins a whole tree
|
|
62
86
|
// including components compiled into other packages. A Sass variable is baked
|
|
63
87
|
// at build time and can never do that.
|
|
64
88
|
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
89
|
+
// The light values, written once and emitted by both the base block and the
|
|
90
|
+
// explicit .theme-light block below. A Sass mixin rather than a copy-paste so
|
|
91
|
+
// the two can never drift — this is build-time templating, not a runtime
|
|
92
|
+
// indirection, and what reaches the browser is still two plain declaration
|
|
93
|
+
// blocks of literals.
|
|
94
|
+
@mixin -light-values() {
|
|
95
|
+
// ===== INK =====
|
|
96
|
+
// Three levels. Full-strength is for the text that matters; muted carries
|
|
97
|
+
// labels and secondary copy; faint is for text that is present but quiet.
|
|
98
|
+
--fs-color-text: rgba(0, 0, 0, 0.87);
|
|
99
|
+
--fs-color-text-muted: rgba(0, 0, 0, 0.54);
|
|
100
|
+
--fs-color-text-faint: rgba(0, 0, 0, 0.38);
|
|
73
101
|
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
102
|
+
// ===== SURFACE =====
|
|
103
|
+
// ONE surface colour for everything that is a surface: a page, a dialog, a
|
|
104
|
+
// card, a menu panel, a dropdown, a bottom sheet. They are all the same kind
|
|
105
|
+
// of thing, so they take the same colour and the app reads as one material.
|
|
106
|
+
//
|
|
107
|
+
// THERE IS DELIBERATELY NO `raised` VARIANT — Ray 2026-09-14. There used to
|
|
108
|
+
// be --fs-color-surface (#232428) and --fs-color-surface-raised (#292A2F),
|
|
109
|
+
// the second six luminance steps lighter so a floating panel read as above
|
|
110
|
+
// the page on a dark ground. Both were #FFFFFF in light mode, so the
|
|
111
|
+
// distinction only ever existed in dark, and it bought a difference nobody
|
|
112
|
+
// had asked for while forcing every consumer to decide which of two nearly
|
|
113
|
+
// identical greys it wanted — and to get it wrong silently, because the
|
|
114
|
+
// fallbacks differ.
|
|
115
|
+
//
|
|
116
|
+
// Elevation is not a colour problem. A surface that must read as floating
|
|
117
|
+
// separates with a shadow, a hairline or a blur; if a genuine need for a
|
|
118
|
+
// second surface colour appears later, add it then, with the case that
|
|
119
|
+
// justifies it. Do not reintroduce `raised` as a default.
|
|
120
|
+
--fs-surface-background: #FFFFFF;
|
|
93
121
|
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
122
|
+
// ===== LINES =====
|
|
123
|
+
// The hairline does most of the structural work: chip outlines, dividers,
|
|
124
|
+
// field borders. Deliberately low-contrast in both modes — it should read
|
|
125
|
+
// as a fold in the surface, not as a drawn line.
|
|
126
|
+
//
|
|
127
|
+
// NOT FOR A CONTROL OUTLINE. An empty checkbox or radio is the control's
|
|
128
|
+
// whole resting state, not a fold in a surface, so it reads
|
|
129
|
+
// --fs-color-text-muted instead — see _form-controls.scss.
|
|
130
|
+
--fs-hairline: #f0f0f0;
|
|
131
|
+
--fs-hairline-strong: rgba(0, 0, 0, 0.38);
|
|
132
|
+
|
|
133
|
+
// ===== FEEDBACK =====
|
|
134
|
+
// The wash under a hovered or pressed surface. A package must never express
|
|
135
|
+
// hover as filter: brightness() — that DARKENS, which is right on a white
|
|
136
|
+
// page and backwards on a dark one. A translucent wash reads correctly in
|
|
137
|
+
// both modes because it takes its tone from whatever is behind it.
|
|
138
|
+
--fs-color-hover: rgba(0, 0, 0, 0.04);
|
|
139
|
+
--fs-color-selected: rgba(0, 0, 0, 0.08);
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
@mixin tokens() {
|
|
143
|
+
:root {
|
|
144
|
+
@include -light-values;
|
|
104
145
|
|
|
105
146
|
// ===== BRAND =====
|
|
106
147
|
// The application's own colour, and the one name a package reads to render
|
|
@@ -119,18 +160,25 @@
|
|
|
119
160
|
// grounds, so a package renders sensibly in an app that has set nothing.
|
|
120
161
|
//
|
|
121
162
|
// NOT PER-SCHEME BY DEFAULT. A brand colour is picked to work on its own
|
|
122
|
-
// ground, so this is a single value rather than a
|
|
163
|
+
// ground, so this is a single value rather than a per-scheme pair -- an app
|
|
123
164
|
// whose brand does need to shift between schemes maps it to a pair of its own
|
|
124
|
-
// when it sets the name above.
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
//
|
|
128
|
-
//
|
|
129
|
-
//
|
|
130
|
-
//
|
|
131
|
-
//
|
|
132
|
-
|
|
133
|
-
|
|
165
|
+
// when it sets the name above. It is declared HERE rather than in the light
|
|
166
|
+
// values above precisely because it does not flip: the dark block must not
|
|
167
|
+
// restate it, and the .theme-light block must not either.
|
|
168
|
+
//
|
|
169
|
+
// THE VALUE COMES FROM $primary-color, the knob in _variables.scss, so an
|
|
170
|
+
// app configures its brand where it configures everything else about this
|
|
171
|
+
// package rather than redeclaring this name afterwards:
|
|
172
|
+
//
|
|
173
|
+
// @use '@firestitch/style/variables' as fsVariables with (
|
|
174
|
+
// $primary-color: var(--brand-primary-colour)
|
|
175
|
+
// );
|
|
176
|
+
//
|
|
177
|
+
// A CSS variable is a legal value there -- see the note on $primary-color --
|
|
178
|
+
// which is what lets an app whose brand is only known at RUNTIME configure
|
|
179
|
+
// it here too, instead of overriding --fs-color-primary at :root and having
|
|
180
|
+
// to get the cascade order right.
|
|
181
|
+
--fs-color-primary: #{variables.$primary-color};
|
|
134
182
|
|
|
135
183
|
// ===== CONTROL FILL =====
|
|
136
184
|
// The INSIDE of an empty checkbox, radio or multi-select tick.
|
|
@@ -142,46 +190,78 @@
|
|
|
142
190
|
// is whatever is behind it: on a dark select panel it reads as a black
|
|
143
191
|
// hole with a grey edge. That is Material's intent and it is wrong here.
|
|
144
192
|
//
|
|
145
|
-
// NEAR-WHITE IN BOTH SCHEMES, deliberately, and this is the
|
|
146
|
-
// does not flip
|
|
147
|
-
//
|
|
148
|
-
//
|
|
149
|
-
//
|
|
150
|
-
// on a light page, so the
|
|
193
|
+
// NEAR-WHITE IN BOTH SCHEMES, deliberately, and this is the other token that
|
|
194
|
+
// does not flip — so it too sits outside the light values above. An empty
|
|
195
|
+
// checkbox should read as paper you are about to mark; that is the
|
|
196
|
+
// affordance, and it is the same affordance on a dark page as on a light
|
|
197
|
+
// one. In light mode it sits on a white surface and disappears behind its
|
|
198
|
+
// own outline, which is exactly how a checkbox looks on a light page, so the
|
|
199
|
+
// single value is correct in both.
|
|
151
200
|
//
|
|
152
201
|
// Consumed by _form-controls.scss, which is the only place that paints it.
|
|
153
202
|
--fs-control-fill: #FFFFFF;
|
|
154
203
|
}
|
|
155
204
|
|
|
156
205
|
// ===========================================================================
|
|
157
|
-
// LIGHT MODE
|
|
206
|
+
// LIGHT MODE, STATED EXPLICITLY
|
|
207
|
+
// ===========================================================================
|
|
208
|
+
// Identical to the base. It exists so that an app toggling between the two
|
|
209
|
+
// markers lands somewhere definite in both directions: going .theme-dark ->
|
|
210
|
+
// .theme-light must RESTORE these values, and it can only do that by
|
|
211
|
+
// declaring them at a specificity that beats the base block. Both selectors
|
|
212
|
+
// here and in the dark block below sit at a flat 0-2-0, so whichever marker
|
|
213
|
+
// is applied last in the DOM does not matter — only which one is present.
|
|
214
|
+
//
|
|
215
|
+
// Listed as separate selectors rather than one :is() so the specificity is
|
|
216
|
+
// the same in every engine.
|
|
217
|
+
//
|
|
218
|
+
// --fs-color-primary and --fs-control-fill are absent on purpose: neither
|
|
219
|
+
// flips with the scheme, so restating them here would be noise that later
|
|
220
|
+
// drifts from the base.
|
|
221
|
+
:root.theme-light,
|
|
222
|
+
:root[data-theme='light'] {
|
|
223
|
+
@include -light-values;
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
// ===========================================================================
|
|
227
|
+
// DARK MODE
|
|
158
228
|
// ===========================================================================
|
|
159
|
-
// The same names restated with their
|
|
229
|
+
// The same names restated with their dark values. Custom properties inherit,
|
|
160
230
|
// so every consumer keeps reading one name and silently gets the right value
|
|
161
231
|
// — a package component never learns which mode it is in, which is the whole
|
|
162
232
|
// point of the contract.
|
|
163
233
|
//
|
|
164
234
|
// BOTH MARKERS, because apps already differ and neither is worth a migration:
|
|
165
|
-
// `.theme-
|
|
166
|
-
// `[data-theme="
|
|
167
|
-
// separate selectors rather than one `:is()` so the specificity stays a flat
|
|
168
|
-
// 0-1-0 in every engine.
|
|
235
|
+
// `.theme-dark` mirrors the `.theme-light` the CloudCure apps set from their
|
|
236
|
+
// ThemeService, `[data-theme="dark"]` is the broader web convention.
|
|
169
237
|
//
|
|
170
238
|
// --fs-color-primary is absent on purpose. A brand colour is picked to work
|
|
171
239
|
// on its own ground and does not flip with the scheme; an app whose brand
|
|
172
240
|
// genuinely needs to shift maps the name to a pair of its own.
|
|
173
|
-
|
|
174
|
-
:
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
241
|
+
//
|
|
242
|
+
// --fs-control-fill is absent for a different reason: it is near-white in
|
|
243
|
+
// BOTH schemes by design — see the note on it above.
|
|
244
|
+
:root.theme-dark,
|
|
245
|
+
:root[data-theme='dark'] {
|
|
246
|
+
--fs-color-text: #E8EDEC;
|
|
247
|
+
--fs-color-text-muted: #97A5A6;
|
|
248
|
+
--fs-color-text-faint: #6A7779;
|
|
178
249
|
|
|
179
|
-
--fs-surface-background: #
|
|
250
|
+
--fs-surface-background: #232428;
|
|
251
|
+
|
|
252
|
+
--fs-hairline: rgba(255, 255, 255, 0.22);
|
|
253
|
+
--fs-hairline-strong: rgba(255, 255, 255, 0.38);
|
|
180
254
|
|
|
181
|
-
--fs-
|
|
182
|
-
--fs-
|
|
255
|
+
--fs-color-hover: rgba(255, 255, 255, 0.08);
|
|
256
|
+
--fs-color-selected: rgba(255, 255, 255, 0.12);
|
|
183
257
|
|
|
184
|
-
|
|
185
|
-
|
|
258
|
+
// A FILLED CHIP HOVERS BY BRIGHTENING ON A DARK GROUND. @firestitch/chip
|
|
259
|
+
// paints its fill as an INLINE style, which beats any stylesheet rule that
|
|
260
|
+
// is not !important, so its hover has to be a filter rather than a colour —
|
|
261
|
+
// and a filter is a function, not a colour, so there is nothing for a colour
|
|
262
|
+
// token to carry. The chip names the AMOUNT instead and this sets it: 90%
|
|
263
|
+
// (darken) is the light default declared in the chip itself, and dark has to
|
|
264
|
+
// go the other way or a hovered chip recedes into the page.
|
|
265
|
+
--fs-chip-hover-brightness: 125%;
|
|
186
266
|
}
|
|
187
267
|
}
|
package/styles/material.scss
CHANGED
|
@@ -31,11 +31,11 @@
|
|
|
31
31
|
// its current light value as the light half, so nothing about the light
|
|
32
32
|
// appearance changes; only the dark half is new.
|
|
33
33
|
--mdc-outlined-text-field-outline-color: rgb(127 127 127 / 38%);
|
|
34
|
-
--mdc-outlined-text-field-hover-outline-color: var(--fs-color-text,
|
|
35
|
-
--mdc-outlined-text-field-input-text-placeholder-color: var(--fs-color-text-muted,
|
|
36
|
-
--mdc-filled-text-field-input-text-placeholder-color: var(--fs-color-text-muted,
|
|
37
|
-
--mdc-outlined-text-field-hover-label-text-color: var(--fs-color-text-muted,
|
|
38
|
-
--mdc-filled-text-field-hover-label-text-color: var(--fs-color-text-muted,
|
|
34
|
+
--mdc-outlined-text-field-hover-outline-color: var(--fs-color-text, rgba(0, 0, 0, 0.87));
|
|
35
|
+
--mdc-outlined-text-field-input-text-placeholder-color: var(--fs-color-text-muted, rgba(0, 0, 0, 0.54));
|
|
36
|
+
--mdc-filled-text-field-input-text-placeholder-color: var(--fs-color-text-muted, rgba(0, 0, 0, 0.54));
|
|
37
|
+
--mdc-outlined-text-field-hover-label-text-color: var(--fs-color-text-muted, rgba(0, 0, 0, 0.54));
|
|
38
|
+
--mdc-filled-text-field-hover-label-text-color: var(--fs-color-text-muted, rgba(0, 0, 0, 0.54));
|
|
39
39
|
|
|
40
40
|
/*
|
|
41
41
|
* Buttons < Angular 20
|