@jskit-ai/material-web 0.1.3 → 0.1.4
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/CHANGELOG.md +2 -0
- package/README.md +2 -1
- package/package.json +1 -1
- package/src/client/material.css +22 -0
- package/test/materialWeb.test.js +15 -0
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
## Unreleased
|
|
4
4
|
|
|
5
|
+
- A text field's label and its supporting text (hints and messages) are on-surface-variant at full strength, as Material 3's text field draws them, instead of Vuetify's on-surface at the medium-emphasis opacity, which read 4.4:1 on a light surface, under WCAG's 4.5:1. A focused field's label keeps the field's colour, and an invalid field's label and messages keep error.
|
|
6
|
+
- A list item's subtitle is on-surface-variant at full strength, as Material 3's list draws its supporting text, instead of the item's on-surface at the medium-emphasis opacity (4.35:1 on surface-container-low). An active item, one with its own text colour and a disabled one keep theirs.
|
|
5
7
|
- Buttons' and pressable chips' state layers are their shape again: the 48dp touch target makes a button's overflow visible, which stopped it clipping Vuetify's overlay and underlay, so hover, focus and press drew a square on every round icon button (an app bar avatar, the rail's menu control) and on disabled ones. They now take the button's corners.
|
|
6
8
|
- A labelled switch sits after its label, at the end of the row, as Material 3 places it, instead of before it. A switch without a label of its own (one in a list row's append slot) stays where it is.
|
|
7
9
|
- `theme.typography: { brand, plain }` names Material 3's brand typeface (display, headline, title-large) and plain one (title-medium and -small, body, label) as CSS font-family values, both Roboto Flex by default. They become the theme variables `--v-font-heading` and `--v-font-body`, which Vuetify's type classes read; `material.css` keeps Roboto Flex for both only as a fallback in the `vuetify-core` layer, so an app's typefaces win. Upgrading: an app with its own fonts names them here instead of overriding `--v-font-body` or `font-family` in CSS.
|
package/README.md
CHANGED
|
@@ -73,7 +73,8 @@ export const theme = {
|
|
|
73
73
|
every button size (small and x-small keep their look, and their state
|
|
74
74
|
layers keep their corners) that stops at a neighbouring button, disabled container
|
|
75
75
|
buttons in on-surface at 12% and 38%, a pagination's current page in the
|
|
76
|
-
activated layer, placeholders
|
|
76
|
+
activated layer, placeholders, text field labels and supporting text and list
|
|
77
|
+
item subtitles in on-surface-variant, one-line labels that
|
|
77
78
|
end in an ellipsis, 12dp card corners, 28dp dialogs on
|
|
78
79
|
`surface-container-high` at level 3 and bottom sheets with a square card on
|
|
79
80
|
`surface-container-low`, square full-screen dialogs on `surface`, a 48dp touch target on clickable chips,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jskit-ai/material-web",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.4",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Exact Material 3 for JSKIT Vuetify apps: seed-generated light and dark schemes, Material Symbols Rounded icon aliases, Roboto Flex and Material 3 component defaults.",
|
|
6
6
|
"exports": {
|
package/src/client/material.css
CHANGED
|
@@ -418,6 +418,28 @@
|
|
|
418
418
|
opacity: 1;
|
|
419
419
|
}
|
|
420
420
|
|
|
421
|
+
/* A text field's label and its supporting text are on-surface-variant at full strength, as Material 3's text field
|
|
422
|
+
draws them, instead of Vuetify's on-surface at the medium-emphasis opacity: 4.4:1 on a light surface, under
|
|
423
|
+
WCAG's 4.5:1. A focused field's label keeps the field's colour, an invalid field's label and messages keep error,
|
|
424
|
+
and a disabled field keeps its own fade. */
|
|
425
|
+
.v-field:not(.v-field--focused, .v-field--error) .v-label.v-field-label {
|
|
426
|
+
color: rgb(var(--v-theme-on-surface-variant));
|
|
427
|
+
opacity: 1;
|
|
428
|
+
}
|
|
429
|
+
|
|
430
|
+
.v-input:not(.v-input--error, .v-input--disabled) > .v-input__details .v-messages {
|
|
431
|
+
color: rgb(var(--v-theme-on-surface-variant));
|
|
432
|
+
opacity: 1;
|
|
433
|
+
}
|
|
434
|
+
|
|
435
|
+
/* A list item's supporting text is on-surface-variant at full strength, as Material 3's list draws it, instead of
|
|
436
|
+
the item's on-surface at the medium-emphasis opacity (4.35:1 on surface-container-low). An active item and one
|
|
437
|
+
with its own text colour keep that colour, and a disabled item keeps its own fade. */
|
|
438
|
+
.v-list-item:not(.v-list-item--active, .v-list-item--disabled, [class*=" text-"]) .v-list-item-subtitle {
|
|
439
|
+
color: rgb(var(--v-theme-on-surface-variant));
|
|
440
|
+
opacity: 1;
|
|
441
|
+
}
|
|
442
|
+
|
|
421
443
|
/* Dividers and table rules use outline-variant at full strength (the theme's border colour). Vuetify draws a
|
|
422
444
|
divider in the text colour, so one without a color prop takes outline-variant. */
|
|
423
445
|
.v-divider {
|
package/test/materialWeb.test.js
CHANGED
|
@@ -280,6 +280,21 @@ test("material.css draws segmented buttons, filter chips, fixed tabs and dialog
|
|
|
280
280
|
css,
|
|
281
281
|
/\.v-field:is\(\.v-field--active, \.v-field--no-label\) :is\(input, textarea\)::placeholder \{\s*color: rgb\(var\(--v-theme-on-surface-variant\)\);\s*opacity: 1;/u
|
|
282
282
|
);
|
|
283
|
+
// A resting field's label and a valid field's supporting text are on-surface-variant at full strength, not on-surface
|
|
284
|
+
// at the medium-emphasis opacity.
|
|
285
|
+
assert.match(
|
|
286
|
+
css,
|
|
287
|
+
/\.v-field:not\(\.v-field--focused, \.v-field--error\) \.v-label\.v-field-label \{\s*color: rgb\(var\(--v-theme-on-surface-variant\)\);\s*opacity: 1;/u
|
|
288
|
+
);
|
|
289
|
+
assert.match(
|
|
290
|
+
css,
|
|
291
|
+
/\.v-input:not\(\.v-input--error, \.v-input--disabled\) > \.v-input__details \.v-messages \{\s*color: rgb\(var\(--v-theme-on-surface-variant\)\);\s*opacity: 1;/u
|
|
292
|
+
);
|
|
293
|
+
// So is an inactive, uncoloured list item's subtitle.
|
|
294
|
+
assert.match(
|
|
295
|
+
css,
|
|
296
|
+
/\.v-list-item:not\(\.v-list-item--active, \.v-list-item--disabled, \[class\*=" text-"\]\) \.v-list-item-subtitle \{\s*color: rgb\(var\(--v-theme-on-surface-variant\)\);\s*opacity: 1;/u
|
|
297
|
+
);
|
|
283
298
|
// A disabled container button is on-surface 12% and 38%, unlayered over its colour class.
|
|
284
299
|
assert.match(
|
|
285
300
|
css,
|