Skip to content

fix(site): hide the secondary download button on non-Linux visitors - #18

Merged
doylefermi-kv merged 1 commit into
mainfrom
fix/site-hidden-button
Aug 20, 2026
Merged

fix(site): hide the secondary download button on non-Linux visitors#18
doylefermi-kv merged 1 commit into
mainfrom
fix/site-hidden-button

Conversation

@doylefermi-kv

Copy link
Copy Markdown
Collaborator

The bug

#dl-secondary rendered as an empty 55×31 box for every Mac and Windows visitor. Live on the site right now — introduced by #17.

Cause

The hidden attribute hides an element via a display: none in the UA stylesheet, which any author rule setting display overrides. .btn sets display: inline-flex, so hidden had no effect on it.

Confirmed on the live page before fixing:

{ hiddenAttr: true, display: "flex", width: 55, height: 31, visible: true }

Worth noting why it slipped through: the #dl-others paragraph directly beside it uses hidden correctly, because .dl-meta happens never to set display. Testing the neighbour would not have caught this.

Fix

[hidden] { display: none !important; }

Global rather than a targeted .btn[hidden] — the next element given hidden hits this the moment it also has a display, and that is not a bug worth discovering twice.

Verification

Both states checked in a browser:

state result
hidden display: none, 0×0
shown renders as a full 304×58 button

So non-Linux visitors get nothing, and the Linux path is unaffected.

It rendered as an empty 55x31 box for everyone on Mac and Windows.

The `hidden` attribute hides an element through a UA-stylesheet
`display: none`, which any author rule that sets `display` silently beats.
`.btn` sets `display: inline-flex`, so `hidden` did nothing to it. The
`#dl-others` paragraph next to it hides correctly only because `.dl-meta`
happens never to set `display` — which is why this was not caught by
testing the neighbouring element.

Fixed with a global `[hidden] { display: none !important; }` rather than a
targeted `.btn[hidden]`: the next element given `hidden` will hit this the
moment it also has a `display`, and that is not a bug worth finding twice.

Verified both states in a browser: hidden collapses to 0x0 with
`display: none`, and unhidden still renders as a full 304x58 button, so the
Linux path is unaffected.
@doylefermi-kv
doylefermi-kv merged commit c6df43d into main Aug 20, 2026
1 check passed
@doylefermi-kv
doylefermi-kv deleted the fix/site-hidden-button branch August 20, 2026 09:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant