oficina / estilo Public

chrome: publish the narrow stacked bar's height with its border, 85px

Fable's P3.3 on estilo #34. Below 800px the stacked header is the 3.25rem
row, the 2rem menu row and its 1px bottom border, 85px, but CSS
published calc(3.25rem + 2rem), 84px. It now publishes
calc(3.25rem + 2rem + 1px). Measured with scripts off in Chromium and
WebKit at 390, 600 and 799px: header 85, published 85 (and 56 and 56
from 800px). A wrapped menu row (320px) is still chrome.js's to publish.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Paul Campbell pushed by paul@keymail.dev fc75cb6909eebca498770e63eb8ce3222156a346 parent 9d7a881
3 files changed, +6 −5
  • chrome/chrome.css +2 −2
  • chrome/chrome.test.mjs +1 −1
  • chrome/stack_test.go +3 −2
diff --git a/chrome/chrome.css b/chrome/chrome.css
index cc44d6e..55ac7f2 100644
--- a/chrome/chrome.css
+++ b/chrome/chrome.css
@@ -350,9 +350,9 @@
grid. The header grows by that row, and the published block size
with it. A menubar that wraps (English at 320px; a long locale
sooner) grows it further: chrome.js then publishes the header's real
- height, and 84px is what a page without script gets. */
+ height, and 85px is what a page without script gets. */
@media (max-width: 799.98px) {
- :root:has([estilo-bar~="stacked"]) { --estilo-bar-block-size: calc(3.25rem + 2rem); } /* 84px: the bar's row and one menubar row. PUBLIC */
+ :root:has([estilo-bar~="stacked"]) { --estilo-bar-block-size: calc(3.25rem + 2rem + 1px); } /* 85px: the bar's row, one menubar row and the bottom border. PUBLIC */
[estilo-bar~="stacked"] {
display: grid;
grid-template-columns: auto minmax(0, 1fr) auto;
diff --git a/chrome/chrome.test.mjs b/chrome/chrome.test.mjs
index caff96a..b43214c 100644
--- a/chrome/chrome.test.mjs
+++ b/chrome/chrome.test.mjs
@@ -263,7 +263,7 @@ test("any other form, or a submit already handled, posts as it always has", () =
assert.equal(fetched, 0);
});
-// A stacked bar below 800px whose menu row wraps is taller than the 84px
+// A stacked bar below 800px whose menu row wraps is taller than the 85px
// CSS publishes; the script publishes its real height there, and stands
// down from 800px, where the header's height is the variable itself.
test("below 800px a stacked bar publishes its real height", () => {
diff --git a/chrome/stack_test.go b/chrome/stack_test.go
index 6730ef8..c15db3b 100644
--- a/chrome/stack_test.go
+++ b/chrome/stack_test.go
@@ -284,14 +284,15 @@ func TestAppearanceIsASegmentedSelectorSwitchedInPlace(t *testing.T) {
}
// The stacked header's public numbers: 56px from 800px, the one-row bar
-// plus its menu row below, and WideOnly's 64rem. The 32px menubar floor
+// plus its menu row and its 1px bottom border below (85px, as measured in
+// Chromium and WebKit; 84 left the border out), and WideOnly's 64rem. The 32px menubar floor
// goes only inside the stacked header.
func TestTheStackedBarPublishesItsHeight(t *testing.T) {
src := string(CSS())
src = src[strings.Index(src, barStackMarker):]
for _, re := range []string{
`@media \(min-width: 800px\) \{\s*:root:has\(\[estilo-bar~="stacked"\]\) \{ --estilo-bar-block-size: 56px; \}`,
- `@media \(max-width: 799\.98px\) \{\s*:root:has\(\[estilo-bar~="stacked"\]\) \{ --estilo-bar-block-size: calc\(3\.25rem \+ 2rem\); \}`,
+ `@media \(max-width: 799\.98px\) \{\s*:root:has\(\[estilo-bar~="stacked"\]\) \{ --estilo-bar-block-size: calc\(3\.25rem \+ 2rem \+ 1px\); \}`,
`@media \(max-width: 63\.99rem\) \{\s*\[estilo-bar-actions\] \[estilo-bar-wide\],\s*\[estilo-bar-actions\] \[estilo-bar-control~="wide"\] \{ display: none; \}`,
`\[estilo-bar~="stacked"\] \[estilo-menubar\] \{[^}]*min-block-size: 0;`,
`\[estilo-bar~="stacked"\] \[estilo-bar-brand\] img \{ inline-size: 32px; block-size: 32px; \}`,