Name the monospace faces once, as a typeface token and md-mono
Both applications show values a person reads or types character by character: SealShare's share tokens and recovery codes, ReStride's file and folder names and its keyboard shortcuts. The package wrote the platform's monospace stack twice (the reset's <code>, <kbd>, <samp> and the mono field) and gave everything else nothing, so an app copied the stack by hand. --md-ref-typeface-mono now holds it, read by the reset, the field and a new md-mono text class; the guard points font-mono at <code> or md-mono. Not an M3 token: M3 names a brand and a plain typeface and nothing for code. Decided with the user (plan step 46). Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5
parent
92d3d761f3
commit
f307079a45
@@ -123,7 +123,7 @@
|
||||
}
|
||||
|
||||
[data-md-field][data-md-mono] [data-md-field-control] {
|
||||
font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace;
|
||||
font-family: var(--md-ref-typeface-mono);
|
||||
}
|
||||
|
||||
[data-md-field-control]::placeholder {
|
||||
|
||||
@@ -78,7 +78,7 @@
|
||||
kbd,
|
||||
samp,
|
||||
pre {
|
||||
font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace;
|
||||
font-family: var(--md-ref-typeface-mono);
|
||||
font-feature-settings: normal;
|
||||
font-variation-settings: normal;
|
||||
font-size: 1em;
|
||||
|
||||
@@ -42,6 +42,9 @@
|
||||
* md-nowrap never wraps: a figure with its unit, a short label
|
||||
* md-tabular tabular figures, where digits change often (tables, clocks,
|
||||
* counters), so the layout does not shift
|
||||
* md-mono the monospace typeface (`--md-ref-typeface-mono`), for a value read
|
||||
* character by character outside `<code>`; after an `md-type-*` class,
|
||||
* whose `font` would otherwise set the brand face
|
||||
* md-visually-hidden read by assistive technology, not drawn: a label a picture already
|
||||
* gives the eye
|
||||
*
|
||||
@@ -309,6 +312,10 @@
|
||||
font-variant-numeric: tabular-nums;
|
||||
}
|
||||
|
||||
.md-mono {
|
||||
font-family: var(--md-ref-typeface-mono);
|
||||
}
|
||||
|
||||
.md-visually-hidden {
|
||||
position: absolute;
|
||||
width: 1px;
|
||||
|
||||
@@ -17,6 +17,12 @@
|
||||
* heavier and fully rounded ("ROND" 100) — the axis that typeface exists for, verified by
|
||||
* `npm run check:font` — and they carry their own tracking, because M3 widens four of them and
|
||||
* takes Display Large's negative tracking back to zero.
|
||||
*
|
||||
* `--md-ref-typeface-mono` is the package's, not M3's (M3 names a brand and a plain typeface and
|
||||
* nothing for code): the platform's own monospace faces, nothing downloaded, for what a person
|
||||
* reads or types character by character — a token, a recovery code, a file or folder name, a key.
|
||||
* `<code>`, `<kbd>` and `<samp>` take it from the reset, a `mono` field from field.css, any other
|
||||
* element from `md-mono` (text.css).
|
||||
*/
|
||||
|
||||
@layer material.reset, material.tokens, material.base, material.layout, material.components, material.text, material.visibility;
|
||||
@@ -25,6 +31,7 @@
|
||||
:root {
|
||||
--md-ref-typeface-brand: 'Google Sans Flex', ui-sans-serif, system-ui, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji';
|
||||
--md-ref-typeface-plain: var(--md-ref-typeface-brand);
|
||||
--md-ref-typeface-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace;
|
||||
--md-ref-typeface-weight-regular: 400;
|
||||
--md-ref-typeface-weight-medium: 500;
|
||||
--md-ref-typeface-weight-bold: 700;
|
||||
|
||||
Reference in New Issue
Block a user