@firestitch/style 18.1.1 → 18.2.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/package.json +1 -1
- package/styles/_form-controls.scss +19 -5
- package/styles/_tokens.scss +82 -25
package/package.json
CHANGED
|
@@ -44,9 +44,23 @@
|
|
|
44
44
|
// =========================================================================
|
|
45
45
|
// CHECKBOX
|
|
46
46
|
// =========================================================================
|
|
47
|
-
// The unselected box is
|
|
48
|
-
//
|
|
49
|
-
|
|
47
|
+
// The unselected box is a CONTROL OUTLINE, so it takes a text colour rather
|
|
48
|
+
// than the hairline.
|
|
49
|
+
//
|
|
50
|
+
// It was the hairline until 18.1.2, on the reasoning that a box outline is a
|
|
51
|
+
// drawn edge. That was wrong, and wrong in a way this package cannot see:
|
|
52
|
+
// --fs-hairline-strong means "a fold in a surface" - a card edge, a divider,
|
|
53
|
+
// a progress track - and an app is entitled to tune it down to almost
|
|
54
|
+
// nothing for exactly that purpose. CloudCure sets it to 22% white, which is
|
|
55
|
+
// correct for a divider and leaves an empty checkbox all but invisible.
|
|
56
|
+
//
|
|
57
|
+
// An empty checkbox is not a fold in a surface. It is the control's entire
|
|
58
|
+
// resting state, the only thing telling the user there is something here to
|
|
59
|
+
// click, and it must read as a line at any value an app might reasonably
|
|
60
|
+
// pick for its dividers. --fs-color-text-muted is the token that means
|
|
61
|
+
// "visible but secondary", which is the job, and it lands near Material's
|
|
62
|
+
// own default (0.54) rather than under it.
|
|
63
|
+
--mat-checkbox-unselected-icon-color: var(--fs-color-text-muted, light-dark(rgba(0, 0, 0, 0.54), #97A5A6));
|
|
50
64
|
--mat-checkbox-unselected-hover-icon-color: var(--fs-color-text-muted, light-dark(rgba(0, 0, 0, 0.54), #97A5A6));
|
|
51
65
|
--mat-checkbox-unselected-focus-icon-color: var(--fs-color-text-muted, light-dark(rgba(0, 0, 0, 0.54), #97A5A6));
|
|
52
66
|
--mat-checkbox-unselected-pressed-icon-color: var(--fs-color-text-muted, light-dark(rgba(0, 0, 0, 0.54), #97A5A6));
|
|
@@ -76,7 +90,7 @@
|
|
|
76
90
|
// =========================================================================
|
|
77
91
|
// Same three questions as the checkbox, same answers - the two controls
|
|
78
92
|
// differ in shape and in whether they are exclusive, never in colour.
|
|
79
|
-
--mat-radio-unselected-icon-color: var(--fs-
|
|
93
|
+
--mat-radio-unselected-icon-color: var(--fs-color-text-muted, light-dark(rgba(0, 0, 0, 0.54), #97A5A6));
|
|
80
94
|
--mat-radio-unselected-hover-icon-color: var(--fs-color-text-muted, light-dark(rgba(0, 0, 0, 0.54), #97A5A6));
|
|
81
95
|
--mat-radio-unselected-focus-icon-color: var(--fs-color-text-muted, light-dark(rgba(0, 0, 0, 0.54), #97A5A6));
|
|
82
96
|
--mat-radio-unselected-pressed-icon-color: var(--fs-color-text-muted, light-dark(rgba(0, 0, 0, 0.54), #97A5A6));
|
|
@@ -191,7 +205,7 @@
|
|
|
191
205
|
// FULL is the variant that draws a box; MINIMAL draws only a checkmark with
|
|
192
206
|
// no container. Both are themed: an app choosing either gets a control that
|
|
193
207
|
// reads, and the two never disagree about what "selected" looks like.
|
|
194
|
-
--mat-pseudo-checkbox-full-unselected-icon-color: var(--fs-
|
|
208
|
+
--mat-pseudo-checkbox-full-unselected-icon-color: var(--fs-color-text-muted, light-dark(rgba(0, 0, 0, 0.54), #97A5A6));
|
|
195
209
|
--mat-pseudo-checkbox-full-selected-icon-color: var(--fs-color-primary, #1B474E);
|
|
196
210
|
--mat-pseudo-checkbox-full-selected-checkmark-color: var(--fs-surface-background, light-dark(#FFFFFF, #232428));
|
|
197
211
|
|
package/styles/_tokens.scss
CHANGED
|
@@ -3,29 +3,50 @@
|
|
|
3
3
|
// =============================================================================
|
|
4
4
|
// The names every @firestitch package reads instead of hardcoding a hex.
|
|
5
5
|
//
|
|
6
|
-
//
|
|
7
|
-
//
|
|
8
|
-
//
|
|
9
|
-
// and setting it; light-dark() reads the `color-scheme` property, which is the
|
|
10
|
-
// ONE mechanism both Material versions and the browser itself already honour.
|
|
11
|
-
// A package that reads these names needs to know nothing about its host.
|
|
6
|
+
// DARK IS THE BASE; LIGHT IS AN OVERRIDE. The dark values are declared plainly
|
|
7
|
+
// on :root, and a second block restates the light ones when the host marks
|
|
8
|
+
// itself light. No light-dark() in any declaration here — read on.
|
|
12
9
|
//
|
|
13
|
-
//
|
|
14
|
-
//
|
|
15
|
-
//
|
|
10
|
+
// WHY NOT light-dark(), WHICH THIS FILE USED UNTIL 18.2.0. It was the right
|
|
11
|
+
// idea and it does not survive the build. light-dark() needs Chrome 123+, and
|
|
12
|
+
// a host whose browserslist still includes an older engine gets it DOWNLEVELLED
|
|
13
|
+
// by esbuild — flattened to its LIGHT half, unconditionally. The failure is
|
|
14
|
+
// silent and total: every token resolves to its light value on a dark ground,
|
|
15
|
+
// so a checkbox outline computes to rgba(0, 0, 0, 0.54) — black on a dark
|
|
16
|
+
// panel, invisible. Nothing warns, the source file looks correct, and the
|
|
17
|
+
// served CSS is the only place the truth shows.
|
|
16
18
|
//
|
|
17
|
-
//
|
|
18
|
-
//
|
|
19
|
+
// That is not a browser-support question a shared package gets to have an
|
|
20
|
+
// opinion about. A host app chooses its own browserslist for its own reasons,
|
|
21
|
+
// and a colour contract that quietly inverts on some of those choices is
|
|
22
|
+
// broken, not merely modern.
|
|
19
23
|
//
|
|
20
|
-
//
|
|
21
|
-
//
|
|
22
|
-
//
|
|
23
|
-
//
|
|
24
|
+
// HOW A HOST SAYS "LIGHT". Either marker works, and an app almost certainly
|
|
25
|
+
// already sets one:
|
|
26
|
+
//
|
|
27
|
+
// <html class="theme-light"> or <html data-theme="light">
|
|
28
|
+
//
|
|
29
|
+
// A host that marks nothing gets the dark values. That is a deliberate default
|
|
30
|
+
// rather than a guess: these packages render on dark app grounds, and a dark
|
|
31
|
+
// token on a light page reads as heavy, while a light token on a dark page
|
|
32
|
+
// disappears completely. Failing toward "too strong" beats failing toward
|
|
33
|
+
// invisible.
|
|
34
|
+
//
|
|
35
|
+
// STILL DECLARED, NOT DETECTED. Nothing here reads prefers-color-scheme. That
|
|
36
|
+
// media query reports the DEVICE, and an app whose user chose Light on a dark
|
|
37
|
+
// phone would then fight its own setting. Resolving the choice is the app's
|
|
38
|
+
// job; this file supplies the values and reads the marker the app already sets.
|
|
39
|
+
//
|
|
40
|
+
// KEEP DECLARING color-scheme TOO. It is what paints the browser's own chrome —
|
|
41
|
+
// caret, scrollbars, autofill, native control internals — which no custom
|
|
42
|
+
// property can reach. It no longer drives these tokens, but it is not
|
|
43
|
+
// redundant.
|
|
24
44
|
//
|
|
25
45
|
// EVERY CONSUMER KEEPS ITS OWN FALLBACK. A package reads these as
|
|
26
46
|
// `var(--fs-hairline, light-dark(#f0f0f0, rgba(255,255,255,.22)))` so that it
|
|
27
|
-
// still renders correctly when @firestitch/style is not installed at all.
|
|
28
|
-
//
|
|
47
|
+
// still renders correctly when @firestitch/style is not installed at all. Those
|
|
48
|
+
// fallbacks keep light-dark() and that is fine — they fire only when the token
|
|
49
|
+
// is undefined, which is exactly the case where this file was never loaded.
|
|
29
50
|
//
|
|
30
51
|
// These are CSS custom properties, not Sass variables, on purpose: they resolve
|
|
31
52
|
// in the browser at paint time, so one declaration re-skins a whole tree
|
|
@@ -37,9 +58,9 @@
|
|
|
37
58
|
// ===== INK =====
|
|
38
59
|
// Three levels. Full-strength is for the text that matters; muted carries
|
|
39
60
|
// labels and secondary copy; faint is for text that is present but quiet.
|
|
40
|
-
--fs-color-text:
|
|
41
|
-
--fs-color-text-muted:
|
|
42
|
-
--fs-color-text-faint:
|
|
61
|
+
--fs-color-text: #E8EDEC;
|
|
62
|
+
--fs-color-text-muted: #97A5A6;
|
|
63
|
+
--fs-color-text-faint: #6A7779;
|
|
43
64
|
|
|
44
65
|
// ===== SURFACE =====
|
|
45
66
|
// ONE surface colour for everything that is a surface: a page, a dialog, a
|
|
@@ -59,14 +80,18 @@
|
|
|
59
80
|
// separates with a shadow, a hairline or a blur; if a genuine need for a
|
|
60
81
|
// second surface colour appears later, add it then, with the case that
|
|
61
82
|
// justifies it. Do not reintroduce `raised` as a default.
|
|
62
|
-
--fs-surface-background:
|
|
83
|
+
--fs-surface-background: #232428;
|
|
63
84
|
|
|
64
85
|
// ===== LINES =====
|
|
65
86
|
// The hairline does most of the structural work: chip outlines, dividers,
|
|
66
87
|
// field borders. Deliberately low-contrast in both modes — it should read
|
|
67
88
|
// as a fold in the surface, not as a drawn line.
|
|
68
|
-
|
|
69
|
-
|
|
89
|
+
//
|
|
90
|
+
// NOT FOR A CONTROL OUTLINE. An empty checkbox or radio is the control's
|
|
91
|
+
// whole resting state, not a fold in a surface, so it reads
|
|
92
|
+
// --fs-color-text-muted instead — see _form-controls.scss.
|
|
93
|
+
--fs-hairline: rgba(255, 255, 255, 0.22);
|
|
94
|
+
--fs-hairline-strong: rgba(255, 255, 255, 0.38);
|
|
70
95
|
|
|
71
96
|
// ===== BRAND =====
|
|
72
97
|
// The application's own colour, and the one name a package reads to render
|
|
@@ -95,7 +120,39 @@
|
|
|
95
120
|
// hover as filter: brightness() — that DARKENS, which is right on a white
|
|
96
121
|
// page and backwards on a dark one. A translucent wash reads correctly in
|
|
97
122
|
// both modes because it takes its tone from whatever is behind it.
|
|
98
|
-
--fs-color-hover:
|
|
99
|
-
--fs-color-selected:
|
|
123
|
+
--fs-color-hover: rgba(255, 255, 255, 0.08);
|
|
124
|
+
--fs-color-selected: rgba(255, 255, 255, 0.12);
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
// ===========================================================================
|
|
128
|
+
// LIGHT MODE
|
|
129
|
+
// ===========================================================================
|
|
130
|
+
// The same names restated with their light values. Custom properties inherit,
|
|
131
|
+
// so every consumer keeps reading one name and silently gets the right value
|
|
132
|
+
// — a package component never learns which mode it is in, which is the whole
|
|
133
|
+
// point of the contract.
|
|
134
|
+
//
|
|
135
|
+
// BOTH MARKERS, because apps already differ and neither is worth a migration:
|
|
136
|
+
// `.theme-light` is what the CloudCure apps set from their ThemeService,
|
|
137
|
+
// `[data-theme="light"]` is the broader web convention. They are listed as
|
|
138
|
+
// separate selectors rather than one `:is()` so the specificity stays a flat
|
|
139
|
+
// 0-1-0 in every engine.
|
|
140
|
+
//
|
|
141
|
+
// --fs-color-primary is absent on purpose. A brand colour is picked to work
|
|
142
|
+
// on its own ground and does not flip with the scheme; an app whose brand
|
|
143
|
+
// genuinely needs to shift maps the name to a pair of its own.
|
|
144
|
+
:root.theme-light,
|
|
145
|
+
:root[data-theme='light'] {
|
|
146
|
+
--fs-color-text: rgba(0, 0, 0, 0.87);
|
|
147
|
+
--fs-color-text-muted: rgba(0, 0, 0, 0.54);
|
|
148
|
+
--fs-color-text-faint: rgba(0, 0, 0, 0.38);
|
|
149
|
+
|
|
150
|
+
--fs-surface-background: #FFFFFF;
|
|
151
|
+
|
|
152
|
+
--fs-hairline: #f0f0f0;
|
|
153
|
+
--fs-hairline-strong: rgba(0, 0, 0, 0.38);
|
|
154
|
+
|
|
155
|
+
--fs-color-hover: rgba(0, 0, 0, 0.04);
|
|
156
|
+
--fs-color-selected: rgba(0, 0, 0, 0.08);
|
|
100
157
|
}
|
|
101
158
|
}
|