Skip to content

Commit a1158d7

Browse files
quantbaiclaude
andcommitted
viz: global [hidden] override to stop the whack-a-mole
Caught the same bug three times in two commits — every element with an explicit display value (.detail-row display:grid, .detail-empty display:flex, etc.) silently overrides the UA stylesheet's default [hidden] { display: none }, so JS-set hidden=true leaves the element visible. User saw this as: empty state + populated detail card showing simultaneously after asset selection. Defensive root fix: add a single global rule near the top of style.css. [hidden] { display: none !important } applies to every element that gains the hidden attribute, regardless of any other display value declared elsewhere. Removed the per-element overrides now made redundant (.detail-row, .detail-empty). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent ad5e939 commit a1158d7

1 file changed

Lines changed: 7 additions & 5 deletions

File tree

docs/style.css

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,13 @@ input {
155155
border: 0;
156156
}
157157

158+
/* Global [hidden] override — any `display` value (flex/grid/block) wins
159+
over HTML5's default `[hidden] { display: none }` from the UA stylesheet,
160+
leaving JS-hidden elements stuck visible. This rule restores expected
161+
semantics for every element on the page (defensive — caught it 3 times
162+
in detail-row, detail-empty, and decision row). */
163+
[hidden] { display: none !important; }
164+
158165
/* Focus ring — WCAG 2.4.13 compliant.
159166
Excludes <path> because Chrome renders both `outline` and `box-shadow` on
160167
SVG <path> as the path's bounding-box rectangle, which ignores the arc
@@ -723,11 +730,6 @@ mark {
723730
border-bottom: 1px solid var(--border);
724731
}
725732

726-
/* HTML5 [hidden] attribute is overridden by any explicit `display` value,
727-
so rows with display:grid stay visible even when JS sets hidden=true.
728-
Restore expected behavior. */
729-
.detail-row[hidden] { display: none !important; }
730-
731733
.detail-row:last-child { border-bottom: none; }
732734

733735
.detail-row dt {

0 commit comments

Comments
 (0)