fix(webkit): catch malformed token shorthands, and restore the popover header min-height - #887
Open
gabriel-lisboa-azion wants to merge 2 commits into
Open
fix(webkit): catch malformed token shorthands, and restore the popover header min-height#887gabriel-lisboa-azion wants to merge 2 commits into
gabriel-lisboa-azion wants to merge 2 commits into
Conversation
…r header min-height A malformed token shorthand never reaches the element, and nothing anywhere reported it — not lint, not vue-tsc, not the build. Two spellings, failing at two different stages: - a stray space inside the parens terminates the Tailwind candidate, so it emits nothing at all; - an inverted bracket/paren form does emit a rule, carrying an invalid value that the browser discards at parse time. The class reads as correct forever either way. chip's `filled` kind was transparent in both themes from the day it shipped because of the first, and its visual baselines were generated from the broken render — so they encoded the bug as correct and no gate ever failed. So `dead-token-shorthand` joins the token-check engine, which makes it blocking on both surfaces at once (write-time hook + repo-wide CI ratchet). It landed with zero grandfathered violations, and immediately found a live one: popover-header's min-height, meant to match the absolute close button, has been inert since the v4 canonicalization sweep. It now names `min-h-7`, mirroring the button's own `size-7` — the token it previously pointed at is 16px, not the 1.75rem it is matching, so both the syntax and the value were wrong. The regex anchors on a `--` inside the parens via lookahead, which is what keeps it off ordinary subtraction (`x -(y + z)`) and off a nested var with a fallback (`var(--a, var(--b))`, where the character before the paren is not a hyphen). Pinned both ways in the token-checks test.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
[--(token)]emits an invalid value the browser discards.dead-token-shorthandjoins the token-check engine, so it blocks write-time and in the repo-wide CI ratchet.popover-header's min-height — meant to match the absolute close button — has been inert since the v4 canonicalization sweep. It now namesmin-h-7, mirroring the button's ownsize-7; the token it previously pointed at is 16px, not the 1.75rem it is matching, so the syntax and the value were wrong.filledkind fully transparent in both themes, with baselines generated from the broken render encoding it as correct — which is why this needs a mechanical gate rather than review.How to test
cd packages/webkit && node --test test/eslint-plugin/token-checks.test.mjs→ 14 pass, including the fires/silent pairs for the new check (ordinary subtraction andvar(--a, var(--b))must stay silent).cd packages/webkit && node scripts/check-authoring.mjs→0 new. Then introducebg-(--bg-surface )in any component undersrc/components/and re-run → it blocks with the new message.pnpm storybook:dev, open Components/Overlay/Popover → Default and inspect the header's innerdiv: computedmin-heightis28px(it wasauto). With a title and no description the title top-aligns with the close button instead of centering.Notes