diff --git a/web/scripts/plate.test.mjs b/web/scripts/plate.test.mjs index b9324f6..c5f3ced 100644 --- a/web/scripts/plate.test.mjs +++ b/web/scripts/plate.test.mjs @@ -33,6 +33,28 @@ test("a button is a plate unless it says otherwise", () => { assert.match(shape, /border-radius: 0/); }); +test("a plate's label is stencilled on", () => { + const shape = rule("button,\n.plate"); + assert.match(shape, /font-family: var\(--font-labels\)/); + assert.match(shape, /text-transform: uppercase/); + assert.match(shape, /letter-spacing:/); +}); + +test("a control that is words to read gives the stencil back", () => { + const reset = [ + ...css.matchAll(/(?:^|\n)((?:\.[\w-]+,\n)+\.[\w-]+)\s*{([^}]*)}/g), + ].find((m) => m[2].includes("text-transform: none")); + assert.ok(reset, "nothing drops the stencilled label any more"); + assert.match(reset[2], /font-family: inherit/); + assert.match(reset[2], /letter-spacing: normal/); + // The bar's own buttons set these capitals for themselves, so a reset on + // them would put the chrome back into sentence case. + assert.ok( + !/\.(account|theme)-button/.test(reset[1]), + "a chrome label is in the reset list", + ); +}); + test("a plate's focus ring is inset", () => { const ring = rule("button:focus-visible,\n.plate:focus-visible"); assert.ok(ring, "no shared focus-visible rule for plates"); diff --git a/web/src/styles.css b/web/src/styles.css index 6efe39e..857f637 100644 --- a/web/src/styles.css +++ b/web/src/styles.css @@ -1819,14 +1819,9 @@ body:has(.hero) { align-items: center; padding: 0.4rem 0.8rem; text-decoration: none; - /* Small tracked capitals in the display face: the same treatment the site's - chrome labels get, so the secondary half is quiet without being a - different kind of thing from the half beside it. */ - font-family: var(--font-labels); - text-transform: uppercase; + /* A step smaller than a plate's default label: this half is quiet, and it + carries a file name rather than an order. */ font-size: 0.75rem; - font-weight: 600; - letter-spacing: 0.1em; /* Tracked capitals are wide, and this half is a file name: broken over two lines it stops reading as a label on a plate. */ white-space: nowrap; @@ -2229,7 +2224,13 @@ button[disabled] { --notch is a property rather than a constant: a full-page button and a 0.7rem chip want the same shape at different sizes. --plate-ring is the colour of the inset ring, and a control that sets its own background sets - this with it. */ + this with it. + + The label is stencilled on: small tracked capitals in the label face, which + is what the bar's links, the daily card's two halves and the waiting + screen's way out already wore. The extra right padding pays back the + letter-spacing added after the last letter, which is otherwise trapped + inside the plate and pushes a centred label left of centre. */ button, .plate { --notch: 0.5rem; @@ -2243,6 +2244,10 @@ button, 0 100%, 0 var(--notch) ); + font-family: var(--font-labels); + font-weight: 600; + letter-spacing: 0.1em; + text-transform: uppercase; } /* A filled plate is accent on accent, and the only ring that shows against @@ -2257,7 +2262,8 @@ button:not(.secondary) { control does, any more than cutting one off a card would - and a Mode that is not built yet is a