feat(Banner): theme target for the description - #5483
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
PR Analysis Report📚 Storybook PreviewView Storybook for this PR 🧪 Sandbox PreviewView Sandbox for this PR Modified ComponentsBanner (@astryxdesign/core) · View in Storybook
Bundle Size Summary
Accessibility AuditStatus: No accessibility violations detected. Visual Regression268 added · 0 removed. View the report To accept these exact frames: Generated by PR Enrichment workflow | Storybook | Sandbox | View full report |
51e8349 to
6a06cd0
Compare
The header's supporting line and its end-aligned actions row render with only StyleX atomics, so a theme cannot reach them: `astryx-banner` stops at the tinted header and the rest of the header is selectable only by child order. Add `astryx-banner-description` and `astryx-banner-actions` via `mergeProps(themeProps(...), stylex.props(...))`, documented in `docs` and `docsZh`. Purely additive.
…lapse toggle `isSingleLine` drives the header's vertical centering and counted `endContent` and the dismiss button, but not the collapse toggle. A collapsible title-only banner therefore kept `align-items: flex-start` while the same banner with a dismiss button centered — its icon and title sat 4px above the 28px toggle beside them. The toggle is the same control in the same row, so it counts.
6a06cd0 to
29eabdb
Compare
There was a problem hiding this comment.
Thanks for narrowing this. banner-description now names a painted element with a demonstrated use, but banner-actions still exposes the flex/wrap/margin/edge-compensation row rather than a visual surface.
In Chromium, the centering commit changes zero pixels under shipped styles in light, dark, RTL, and forced colors; it only changes pixels after that private row margin is overridden. Setting padding-block on the existing banner target gets the same 44→52px result and keeps the title/control centers equal without exposing the row.
Could we keep banner-description and drop banner-actions plus the centering commit?
[Reviewed by Robohands]
|
Title and body refreshed — thanks for catching that; both still described the two-target, two-commit version that no longer exists. Title is now |
|
Merged latest main (17 commits behind) — which also regenerates the visual evidence, since the report from 27 Aug had expired to a 404 and Component suite re-run green on the merge. No source change in this push. |
|
/accept-visual |
|
Visual acceptance refused: copy the exact |
cixzhang
left a comment
There was a problem hiding this comment.
The target itself is well placed on documented, painted anatomy, and unthemed pixels remain unchanged. One mechanical requirement is missing: visual:probe-theme:check fails because generated probe coverage does not include banner-description.
Please regenerate and commit the required probe output so the visual gate exercises the new public target.
[Reviewed by Robohands]
`visual:probe-theme:check` was failing: the generated probe theme did not cover `astryx-banner-description`, so the visual gate could not exercise the new public target. The generator emits the file wholesale, so this also picks up probe coverage that main is already missing — `carousel-scroller` with its three `presentation:` variants (#5601) and `dropdown-menu-divider`'s `size:xl`. Clean `origin/main` fails the same check today; no workflow runs the guard, so the drift accumulates until a PR that touches a theming target regenerates it.
|
Regenerated and pushed in The generated file carries more than my target, and I want to be explicit about which is which. The generator emits
I could not commit only my own entry — the file is The reason it drifted is that no workflow runs this guard. Verification
|
cixzhang
left a comment
There was a problem hiding this comment.
Thanks, this addresses my previous review: probe coverage now includes banner-description. Please add a direct Banner test pinning that target before merge; no further review needed.
[Reviewed by Robohands]



Follows #5417 — same problem, one more component.
What is unreachable today
Bannerexposes three theme targets —astryx-banner(the tinted header),astryx-banner-icon, andastryx-banner-content. The header's supporting line renders with barestylex.props, so a theme that wants to restyle it has to reach in with a structural selector:That says "the second div inside the second div", which is a guess about internals — it keeps parsing and silently stops matching the day the DOM changes.
The change
One target:
astryx-banner-description.It names a painted element with a demonstrated use. Astryx paints the description
--color-text-secondary; a downstream theme of ours wants it primary, and today the only way there is re-scoping--color-text-secondaryacross the whole header, which repaints everything else in there that reads the token. It also owns the 2px gap under the title — the header's text column isgap: 0, andbanner'srowGapis the wrap gap, not this one.Purely additive: no existing class, data attribute or style changes, and the render is byte-identical.
What came out, and why
Two things from review, both correct:
banner-actionsis gone. It named the end area, which is a layout row — flex, wrap,margin-inline-start: auto, and the negative block margin that lets its buttons overhang the header padding. Not a painted surface, so it fails the theme-target rule the same way adisplay: contentswrapper does. The use it was meant to serve — a header that grows around its buttons rather than letting them overhang — ispadding-blockon the existingbannertarget, which reaches the same 44→52px without exposing a private margin as contract.The centring commit is reverted, and @cixzhang was right that it changed nothing. I checked before deleting it. Measured in Chromium, forcing both alignments on the same DOM:
The arithmetic: the title's line box is 14px × 1.4286 = 20px, and the toggle is a 28px control carrying
marginBlock: -4px— so its outer height is 28 − 8 = 20px too. Both items are 20px, the row is 20px, andalign-itemshas nothing to resolve. That negative margin exists precisely to cancel the 4px I claimed was a bug: I reasoned from the button's 28px and missed the margin two lines above it in the same stylesheet.It would only ever have fired once a theme overrode that margin — which is to say, only through
banner-actions. Removing one removed the other's reason to exist.Verified the alternative too:
padding-block12px → 16px onbannertakes a title-only header 44 → 52px with the title and control centres still equal at 0px offset.Nothing else in the header becomes a target
The title, the two controls and the text column are deliberately left alone: the column paints nothing (
display: flex; flex-direction: column; gap: 0) and the space it owns is expressible onbanner-description, while the title and the controls already render the way the consuming theme wants them. The changeset says so, so the next person does not re-propose the row.Verification
pnpm exec vitest run packages/core/src/Banner— 52 pass.tsc --noEmitclean,lint:strict0 errors in the touched files.