Repository navigation
fix(editor): stop saved-block surfaces rendering with square corners - #896
Merged
Merged
Conversation
The saved-blocks browser card, its focus ring, the rename row, the loading skeleton and the save dialog's preview rows read var(--tpl-radius-md). That name is Tailwind's prefixed --radius-md, emitted on :root/:host where --tpl-base-size doesn't exist, so it resolved to nothing and border-radius computed 0. All five now use --tpl-radius-sm (7px). A new "Token references" group in design-system-conformance.test.ts fails on any var(--tpl-*) that styles/index.css doesn't declare.
Deploying templatical-docs with
|
| Latest commit: |
893847f
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://a2a28731.templatical-docs.pages.dev |
| Branch Preview URL: | https://claude-radius-md-token-295e5.templatical-docs.pages.dev |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Merged
7 of 14 tasks
orkhanahmadov
enabled auto-merge (squash)
October 9, 2026 20:46
A new apps/docs parity test fails in three cases: - the --tpl-user-* table in guide/theming.md (EN and DE) stops matching the hooks styles/index.css reads - the new Dark column stops marking exactly the hooks that have a --tpl-user-dark-* twin - the config-key table drifts from ThemeOverrides It caught two gaps, now fixed. --tpl-user-on-primary was read but undocumented. The guide also promised a dark twin for every hook, although radius, base size, font, transition and on-primary have none. The editor README drops its stale "27 design tokens" count, and the house-style rule against token counts now covers it.
Deploying templatical-playground with
|
| Latest commit: |
893847f
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://8e55342c.templatical-playground.pages.dev |
| Branch Preview URL: | https://claude-radius-md-token-295e5.templatical-playground.pages.dev |
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
Five saved-block surfaces rendered with square corners:
All five read
var(--tpl-radius-md), which is not one of the editor's radius tokens. They now read--tpl-radius-sm(7px).Why it resolved to nothing
prefix(tpl)puts Tailwind's own theme variables in the same--tpl-*namespace as the SDK's tokens, so--tpl-radius-mdnamed Tailwind's--radius-md. Tailwind saw the reference and emitted it:--tpl-base-sizeis declared only on.tpl, so at:root/:hostthat declaration is invalid at computed-value time. Every descendant inherits the invalid value, andborder-radiusfalls back to0. The name even appears in the builtstyle.css, which is why it looked defined everywhere except in the computed style. I reproduced it in the playground: giving the shadow host a--tpl-base-sizemakes the cards settle at 6px.Why
--tpl-radius-smThis was the owner's call:
tpl:rounded-mdsearch box, filter, rename inputs and dialog buttons around these surfaces.--tpl-user-radius-sm.Alternatives that were rejected:
--tpl-radius(10px) is noticeably rounder than every control next to it.tpl:rounded-mdignores--tpl-user-radius*, and the overlay's<style>rule would have to spell out the calc.--tpl-radius-mdtoken would sit below-smat the 6px DESIGN.md mentions, and it would lock in the colliding name.The focus overlay reads the same token as the card, so the ring follows the card's corners.
Guard
A new "Token references" group in
design-system-conformance.test.tsrequires everyvar(--tpl-*)inpackages/editor/srcto name one of these:styles/index.cssdeclares--tpl-drop-text,--tpl-doc-link-color,--tpl-doc-link-underline,--tpl-doc-paragraph-spacing), each mapped to the file that sets it. A stale-entry case keeps that map honest.--tpl-user-*hook, but only insidestyles/index.css. A component reading a hook directly would bypass thethemeoption and the dark namespace.A self-test runs the detector on the exact shapes that shipped: the arbitrary-value class and the CSS rule.
The changeset also corrects the 0.7.0 notes, which gave
--tpl-user-radius-mdas an example theming hook. The editor has never read that hook.Theming docs parity
apps/docs/tests/theming-hooks-parity.test.tspinsguide/theming.mdand its German mirror to the editor's actual theming surface:--tpl-user-*table lists exactly the hooksstyles/index.cssreads.--tpl-user-dark-*twin (29 of 36).ThemeOverrideskey table lists exactly that type's keys. These were already in parity, so this is a guard only.The test failed on today's docs and caught two gaps, now fixed in EN and DE:
--tpl-user-on-primaryis read but was undocumented. It now has a row, plus a note: unset, it follows the active background; setting it fixes one color for both modes, and a near-white label fails contrast on the lighter dark-mode primary.--tpl-user-with--tpl-user-dark-in any token name", but radius, radius-sm, radius-lg, base-size, font-family, transition and on-primary have no twin. The sentence now points at the ✓ rows.The extra column narrowed the token-name column, so a few names wrapped at a hyphen. To win the width back, the
base-sizepurpose cell's link text is shorter and the German header is "Dark". Measured at 1280px, EN wraps no names and DE the same two as on main.public/llms-full.txtwas regenerated. The editor README's stale "27 design tokens" now uses the root README's #751 wording with no count, and the existing house-style rule now covers both READMEs.Linked issues
n/a. This is one of the two pre-existing issues listed as out of scope in #881.
Type of change
Affected packages
@templatical/editor(source and README),apps/docs(theming guide EN+DE, tests, regeneratedllms-full.txt),apps/playground(e2e only)Checklist
on-primaryrow and the absent dark marks. Before the fix, the guard failed listing exactly the 5 sites, and the e2e "keyboard focus rings the whole card" failed with0pxagainst the expected7pxin both projects.saved-blocks.spec.tsandmodal-theming.spec.tspass locally in both projects (58/58). The full suite runs in CI.guide/theming.mdandde/guide/theming.md, locked by the new parity test (it failed before the doc fix)patch)Screenshots / recordings
I reviewed before/after captures locally (headless Chromium, 2x, both DOM modes). These are the computed values:
::after)Notes for reviewers
SavedBlocksBrowserModal.vuethis touches only the three radius classes and the focus-overlay rule, plus one sentence in that rule's comment. That keeps it disjoint from the in-flight delete-confirm wrap fix, which edits the card's bottom row.:root,:hostcopies of--tpl-radius,--tpl-radius-sm,--tpl-radius-lgand--tpl-shadow-sm…xl, because the SDK reads those names too. They are harmless only because.tplredeclares them. The guard now fails any reference that could resolve only through such a copy.