Repository navigation
fix(core): a theme radius of different corners reaches what a Card, a Dialog and a menu hand each corner to - #12388
josephfarina wants to merge 11 commits into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
AI review status for this pull request.
|
PR Analysis Report🔎 Preview ·
|
There was a problem hiding this comment.
Changes requested. Card and Dialog now hand each themed corner to a full-bleed Table or bleeding List, and the last push fixed the typecheck and docsite-build failures, but these still need fixing:
- A default Card nested in a Card whose theme variant sets a radius hands its full-bleed Table the outer card's corners (24px against its own 12px), because the new corner variables inherit and nothing resets them on the Card, Dialog or menu root (
Card.tsx:98-123). - Sub-menu rows keep the old single-radius rule (
DropdownMenuSubMenu.tsx:146), so they stay square while their sibling rows follow the menu; applymenuRowCornerStyles.rootthere. lintnow fails because writingborderRadius: '0'pushedContainerCorners.stories.tsx:259past Prettier's line width, so run Prettier on that file.- The changeset says an elliptical radius reaches a bleeding List and menu rows, but both stay square because they subtract padding from the corner (only a Table takes it), and the description's "before" radii were 0, not 12 at every corner.
ComponentThemingDerivedVar.cornersis a new public type member of@astryxdesign/cli, so name it on theComponents:line and correct the "No new public API" checkbox.
Separately, approval also waits on an engineering owner deciding which corners menu rows take when a theme gives the menu different corners: every row mirroring the menu's shape, as here, or only the rows at a corner. An engineering owner records that decision with /approve-spec <full head SHA> on an amended record, and the author may do so as an engineering owner.
Claims and files checked
Review mode: incremental; reason: none
- Changed rules (0).
Claims:
- Different-corner theme radii reach a full-bleed Table or bleeding List in a Card or Dialog, ring and fills included: verified (Chromium, Table 24 24 0 0; last List row 0 0 24 24).
- A logical corner longhand reaches the right corner in right-to-left: verified (Chromium, card and Table 0 20 0 0).
- Menu rows take the menu's shape less its padding: verified for item and checkbox rows (0 0 12 12) and radio rows (same shared style); false for sub-menu rows.
- An elliptical radius reaches these children: verified for Table (24px 12px); false for List and menu rows (0).
- Before the change these children took one radius or none: they took none (0); the description's 12 12 12 12 reproduction is false.
- The pipeline writes per-corner private variables only for flagged components: verified (
generateThemeRules.ts:1656-1692, unit tests). - A variant's one-value radius overrides a base rule's corners: verified (every corner rewritten, unit test).
- A one-value radius draws as before: verified for a container's own rule; false for a Card nested in a themed variant.
- No new public API: false (
ComponentThemingDerivedVar.corners). - The docsite keeps the
cornersfield: verified (projection test passes). - Story and test fixtures use string radii: verified (typecheck passes); the story line now fails Prettier.
- The theme suites pass: verified (578 tests locally).
- No internal context in public text: verified.
Files:
.changeset/theme-corners-reach-children.md: elliptical claim overstated.apps/docsite/scripts/generate-data.mjs: clear.apps/docsite/scripts/lib/theming-doc.mjs: clear (fixed).apps/storybook/stories/ContainerCorners.stories.tsx: Prettier failure at line 259.packages/cli/authoring/doctypes/base/type.ts: new public member outside the scope line; doc comment not attached.packages/core/src/Card/Card.doc.mjs: clear.packages/core/src/Card/Card.tsx: nested inheritance.packages/core/src/ContextMenu/ContextMenu.doc.mjs: clear.packages/core/src/Dialog/Dialog.doc.mjs: clear.packages/core/src/Dialog/Dialog.tsx: nested inheritance.packages/core/src/DropdownMenu/DropdownMenu.doc.mjs: clear.packages/core/src/DropdownMenu/DropdownMenuCheckboxItem.tsx: clear.packages/core/src/DropdownMenu/DropdownMenuItem.tsx: clear.packages/core/src/DropdownMenu/DropdownMenuRadioItem.tsx: clear.packages/core/src/DropdownMenu/menuRowCorners.stylex.ts: sub-menu rows not covered; menu-row shape awaits an owner decision.packages/core/src/Layout/__tests__/ContainerCorners.a11y.chromium.spec.ts: clear; no nested case.packages/core/src/Layout/containerCorners.stylex.ts: clear.packages/core/src/theme/derivedVarRegistry.test.ts: clear.packages/core/src/theme/derivedVarRegistry.ts: clear.packages/core/src/theme/generateThemeRules.test.ts: clear (fixed).packages/core/src/theme/generateThemeRules.ts: corner variables written without a reset on unmatched instances.
4f531f8 to
c6ab36c
Compare
There was a problem hiding this comment.
Changes requested. Card and Dialog now hand each themed corner to a full-bleed Table or bleeding List, and the last push fixed the earlier Lint failure, but these still need fixing:
- A default Card nested in a Card whose theme variant sets a radius hands its full-bleed Table the outer card's corners (24px against its own 12px), because the new corner variables inherit and nothing resets them on the Card, Dialog or menu surface roots (
Card.tsx:98-123). - Sub-menu rows keep the old single-radius rule (
DropdownMenuSubMenu.tsx:146), so they stay square while their sibling rows follow the menu; applymenuRowCornerStyles.rootthere and drop the old rule. - The changeset says an elliptical radius reaches a bleeding List and menu rows, but both stay square because they subtract padding from the corner (only a Table takes it), and the description's "before" Table radii were 0, not 12 at every corner.
ComponentThemingDerivedVar.cornersis a new public type member of@astryxdesign/cli, so name it on theComponents:line and correct the "No new public API" checkbox.
Separately, approval also waits on an engineering owner deciding which corners menu rows take when a theme gives the menu different corners: every row mirroring the menu's shape, as here, or only the rows at a corner. An engineering owner records that decision with /approve-spec <full head SHA> on an amended record, and the author may do so as an engineering owner.
Claims and files checked
Review mode: full; reason: rebase
Claims:
- Different-corner theme radii reach a full-bleed Table in a Card, focus ring included: verified (Chromium, 24 24 0 0; the base draws 0 0 0 0).
- The last bleeding List row in a Dialog takes the bottom corners and the first stays square: covered by the new Chromium case (read; not run here because CI's browser jobs did not run).
- A logical corner longhand reaches the right corner in right-to-left: covered by the
:dir(rtl)mapping and the new Chromium case (read). - Menu rows take the menu's shape less its padding: verified for item and checkbox rows (0 0 12 12) and radio rows (same shared style); false for sub-menu rows (0 0 0 0).
- An elliptical radius reaches these children: verified for Table (24px 12px); false for List and menu rows (0).
- Before the change these children took one radius or none: they took none (0); the description's 12 12 12 12 reproduction is false.
- The pipeline writes per-corner private variables only for flagged components: verified (unit tests).
- A variant's one-value radius overrides a base rule's corners: verified (every corner rewritten, unit test).
- A one-value radius draws as before: verified for a container's own rule; false for a Card nested in a themed variant.
- No new public API: false (
ComponentThemingDerivedVar.corners). - The theme, Card, Dialog, menu and Layout suites pass: verified (1,383 and 578 tests).
- No internal context in public text: verified.
Files:
.changeset/theme-corners-reach-children.md: elliptical claim overstated.apps/docsite/scripts/generate-data.mjs: clear.apps/docsite/scripts/lib/theming-doc.mjs: clear.apps/storybook/stories/ContainerCorners.stories.tsx: clear (Prettier fixed).packages/cli/authoring/doctypes/base/type.ts: new public member outside the scope line; doc comment not attached.packages/core/src/Card/Card.doc.mjs: clear.packages/core/src/Card/Card.tsx: nested inheritance.packages/core/src/ContextMenu/ContextMenu.doc.mjs: clear.packages/core/src/Dialog/Dialog.doc.mjs: clear.packages/core/src/Dialog/Dialog.tsx: nested inheritance.packages/core/src/DropdownMenu/DropdownMenu.doc.mjs: clear.packages/core/src/DropdownMenu/DropdownMenuCheckboxItem.tsx: clear.packages/core/src/DropdownMenu/DropdownMenuItem.tsx: clear.packages/core/src/DropdownMenu/DropdownMenuRadioItem.tsx: clear.packages/core/src/DropdownMenu/menuRowCorners.stylex.ts: sub-menu rows not covered; menu-row shape awaits an owner decision.packages/core/src/Layout/__tests__/ContainerCorners.a11y.chromium.spec.ts: clear; no nested case.packages/core/src/Layout/containerCorners.stylex.ts: clear.packages/core/src/theme/derivedVarRegistry.test.ts: clear.packages/core/src/theme/derivedVarRegistry.ts: clear (long doc sentence, non-blocking).packages/core/src/theme/generateThemeRules.test.ts: clear.packages/core/src/theme/generateThemeRules.ts: corner variables written without a reset on unmatched instances.
|
/approve-spec 5864240 |
… Dialog and a menu hand each corner to - The theme pipeline writes each corner of a radius to its own private variable (<var>-top-left … from the shorthand or a physical longhand, <var>-start-start … from a logical longhand) for components whose derived borderRadius entry sets the new corners flag: card, dialog, dropdown-menu, context-menu. - Card and Dialog publish each of their corners to a full-bleed Table or List (a logical corner first, else the physical corner it is in this direction, else the one radius). - A menu's rows take each menu corner less the menu's padding. - A radius of one value draws as before.
…ixtures use string radii
…ts own corners; sub-menu rows follow the menu [skip ci]
…hromium cases [skip ci]
…s out each corner [skip ci]
…s the pointer menu [skip ci]
…y read corners themselves [skip ci]
There was a problem hiding this comment.
Approved pending CI: CI has not run on this head yet. A themed radius with different corners now reaches a Card's or Dialog's full-bleed Table and bleeding List rows, every pointer-menu row follows the menu's shape as the new DropdownMenu decision records, and the four earlier findings are fixed. Next, rebase onto main: generateThemeRules.ts and its test conflict with main's reworked theme compiler, so CI cannot run until that is resolved, and main now lowers :hover blocks through the same derived path, so keep the corner fan-out there.
- Non-blocking: a physical corner longhand written after a logical one for the same corner (a variant's
borderTopLeftRadiusover a baseborderStartStartRadius) still hands the child the logical value, as the description notes. - Non-blocking: the container-padding record's Owning code still says Card and Dialog set the radius at each block edge; they now copy each corner.
Claims and files checked
Review mode: full; reason: over-500-lines
- The release note says a per-corner theme radius on a Card or Dialog reaches a full-bleed Table or bleeding List, focus ring and fills included: verified in Chromium (Table 24 24 0 0 with its ring on the curve; last bleeding row 0 0 16 16).
- The release note says pointer-menu rows, sub-menu and flyout rows, and ContextMenu rows take the menu's shape less its padding: verified in Chromium (0 0 12 12 on all six menu rows and on ContextMenu rows).
- The release note says touch-sheet list rows and a drilled-in sub-menu view with a header or footer keep their own corners: verified from the code (only the four row components apply the row corners; the drilled-in frame resets them and carries no theme target,
DropdownMenuSubMenu.tsx:1236-1241). - The release note says an elliptical corner reaches a full-bleed Table only, while List and menu rows stay square: verified from the code (two-value corners from
radiusCorners; List and menu rows subtract padding insidecalc()). - The release note says a default Card, Dialog or menu inside a themed one keeps its own corners: verified (Chromium nested Card keeps 12px; resets in
Dialog.tsx:225-234and every menu surface). - The release note says these children were square before, or took the first corner everywhere when the theme editor wrote the radius: verified (base Chromium 0 0 0 0; the editor writes the shorthand as the first corner,
_settings.mjs). - The release note says the pipeline writes each corner to its own private variable only for flagged entries: verified (
generateThemeRules.test.ts; a button radius writes no corner variable). - The release note says a one-value radius draws as before: verified (a one-radius menu draws pixel-identical rows; the published themes' built surface is unchanged).
- The description says the base Table drew 0 0 0 0 and menu rows took no radius: verified on the base in Chromium.
- The description says a logical start corner in a right-to-left page reaches the table's top-right, and a physical corner stays where the card draws it: verified in Chromium (0 20 0 0; 12 0 0 0).
- The description says a one-value variant over a per-corner base draws one radius everywhere: verified from the code (the shorthand writes all four corners and clears the logical ones,
generateThemeRules.ts:1661-1673). - The description says the theme editor takes a menu radius of different corners, still refuses a slash radius, and drops the single-radius note when Core flags corners: verified (
_check.mjs:7258-7273,_edit.mjs:6778-6786, the new CLI test passes). - The description says a physical longhand after a logical one leaves the logical variable set: verified (
generateThemeRules.ts:1675-1681); a non-blocking gap. - The description says every container and menu surface resets its corner variables: verified in the diff (Card, Dialog, DropdownMenu, its flyout and region, ContextMenu, Breadcrumbs).
- The description says the documented-variables check counts corner variables from one shared list: verified (
derivedVarRegistry.test.ts:511-517,radiusCornerVars). - The description says seven new Chromium cases were added and existing expectations are unchanged: verified in the spec diff.
- The description says one new public type member is added and the corner variables are private: verified (built surface: no change in Core or the themes;
type.ts:496). - The description says the local CI run passes: not verifiable here, since CI has not run at this head; Core typecheck, ESLint, Prettier and the touched unit and CLI tests pass in this review.
- The description says public text carries no internal context: verified.
.changeset/theme-corners-reach-children.md: clearapps/docsite/scripts/generate-data.mjs: clearapps/docsite/scripts/lib/theming-doc.mjs: clearapps/storybook/stories/ContainerCorners.stories.tsx: cleardocs/specs/components/DropdownMenu/DropdownMenu.spec.md: clearpackages/cli/api/theme-edit/_check.mjs: clearpackages/cli/api/theme-edit/_context.mjs: clearpackages/cli/api/theme-edit/_edit.mjs: clearpackages/cli/api/theme-edit/_settings.mjs: clearpackages/cli/api/theme-edit/theme-corners-content-each-corner.test.mjs: clearpackages/cli/authoring/doctypes/base/type.ts: clearpackages/core/src/Breadcrumbs/BreadcrumbItem.tsx: clearpackages/core/src/Card/Card.doc.mjs: clearpackages/core/src/Card/Card.tsx: clearpackages/core/src/ContextMenu/ContextMenu.doc.mjs: clearpackages/core/src/ContextMenu/ContextMenu.tsx: clearpackages/core/src/Dialog/Dialog.doc.mjs: clearpackages/core/src/Dialog/Dialog.tsx: clearpackages/core/src/DropdownMenu/DropdownMenu.doc.mjs: clearpackages/core/src/DropdownMenu/DropdownMenu.tsx: clearpackages/core/src/DropdownMenu/DropdownMenuCheckboxItem.tsx: clearpackages/core/src/DropdownMenu/DropdownMenuItem.tsx: clearpackages/core/src/DropdownMenu/DropdownMenuRadioItem.tsx: clearpackages/core/src/DropdownMenu/DropdownMenuSubMenu.tsx: clearpackages/core/src/DropdownMenu/menuRowCorners.stylex.ts: clearpackages/core/src/Layout/__tests__/ContainerCorners.a11y.chromium.spec.ts: clearpackages/core/src/Layout/containerCorners.stylex.ts: clearpackages/core/src/theme/derivedVarRegistry.test.ts: clearpackages/core/src/theme/derivedVarRegistry.ts: clearpackages/core/src/theme/generateThemeRules.test.ts: clearpackages/core/src/theme/generateThemeRules.ts: clear
| } else if (prop in RADIUS_CORNER_PROPS) { | ||
| for (const varName of cornerVarRoots) { | ||
| const name = `${varName}-${RADIUS_CORNER_PROPS[prop]}`; | ||
| cornerProps.delete(name); | ||
| cornerProps.set(name, value); |
There was a problem hiding this comment.
Non-blocking: a physical longhand here leaves an earlier logical variable for the same corner set, and the readers take the logical one first. With card: {base: {borderStartStartRadius: '4px'}, 'variant:muted': {borderTopLeftRadius: '20px'}}, a muted card in a left-to-right page draws 20px at the top left while its Table takes 4px. The description already names this gap; it is narrow enough to leave, but worth a test that pins the current behaviour.
5864240 to
41bff50
Compare
|
/approve-spec 41bff50 |
There was a problem hiding this comment.
Approved pending CI: no build, test or lint run has finished on this head yet, so this is not a merge-ready signal; the merge guard holds until the required checks pass.
A theme radius whose corners differ now reaches what a Card, a Dialog and a pointer menu hand each corner to, and the four findings of the earlier reviews are fixed and re-measured at this head: a default Card inside a themed Card keeps its own corners, the sub-menu trigger row follows the menu, the release note's elliptical wording is accurate, and the stories file is formatted. No blocking finding remains.
Two things worth a look, neither blocking:
- A physical corner longhand written after a logical one for the same corner leaves the logical variable set, so a muted card can draw
20pxat the top left while its full-bleed Table takes the earlier logical4px; the description names this gap, and a test pinning today's behaviour would keep it from drifting. - The eight-line corner reset is repeated in five files; a ninth surface that forgets it will hand a nested default menu its ancestor's corners.
Claims and files checked
Review mode: full; reason: rebase
Claims:
- Release note: a theme radius with different corners now reaches a Card's or a Dialog's full-bleed Table and bleeding List, focus ring and row fills included — verified: Chromium at this head: card
12px 12px 0px 0pxwith the Table's scroll region12px 12px 0px 0px(base0px 0px 0px 0px); a Dialog themed0 0 16px 16pxgives its last bleeding row0 0 16px 16px; the Tab-focused scroll region's ring follows that curve. - Release note: the rows of a pointer menu, sub-menu rows included, take the menu's shape less its padding — verified: all six rows (item, checkbox, two radios, the sub-menu trigger and the flyout's row) measure
0 0 8px 8pxunder a menu themed0 0 12px 12pxwith 4px menu padding. - Release note: the touch sheet's list rows and a drilled-in sub-menu view with its own header or footer keep their own corners — verified: the bottom-sheet presentation renders its rows through MenuBottomSheetActionList (a List), and the header/footer region style resets the corner variables and sets the default container radius.
- Release note: an elliptical corner reaches a full-bleed Table, while a List and menu rows keep square corners there — verified: a Card themed
8px / 4pxgives its Table8px 4pxat each corner; a bleeding List in the same card and every row of a menu themed16px / 8pxmeasure0px. - Release note: a default Card, Dialog or menu inside a themed one keeps its own corners — verified: a default Card inside a muted Card themed
24pxhands its Table12px 12px 12px 12pxon both base and head; every surface resets its eight corner variables. - Release note: before the change these children kept square corners, or took the first corner's radius where the CLI editor wrote the radius — verified: base measurements show
0pxon every such child; the editor's first-corner note and its single-radius message are in the editor source and its test. - Release note: the pipeline writes each corner only for components whose derived radius entry sets the new flag, and a one-value radius draws as before — verified: the unit test shows no corner variable for Button; the built CSS of the seven published themes changes only by card corner variables carrying the radius they already drew, three of the seven byte-identical.
- Description: the compiler writes each corner from the shorthand, a physical longhand and a logical longhand, a later radius replaces an earlier one, and the shorthand leaves no logical corner — verified: the corner map in the compiler plus five new unit tests covering each case, including the parser's 1-4 value fill and its
/handling. - Description: the flag is set on card, dialog, dropdown-menu and context-menu in the registry, the component docs and the authoring type — verified: all four registry entries, four doc entries and the new optional member in the authoring type.
- Description: Card and Dialog set their four corner publications from those variables, with the right-to-left mapping, in one shared place — verified: both components copy their radius variables into the shared host variables and apply the one shared corner reading before the publication.
- Description: one shared style gives the item, checkbox, radio and sub-menu rows their corners — verified: the new menu-row style is imported by exactly those four row components and by nothing else.
- Description: Card, Dialog and each menu surface reset their corner variables — verified: nine reset blocks across Card, Dialog (dialog and inline wrapper), DropdownMenu, its flyout and region, ContextMenu's two surfaces and the Breadcrumbs overflow menu.
- Description: the CLI theme editor takes a menu radius of different corners, and a slash radius is still refused there — verified: a probe run of the editor:
0 0 12px 12pxon the menu is accepted,8px / 4pxis still refused, and a five-value radius is refused by the grammar check before the relaxed one. - Description: the CLI theme editor no longer says a card's content takes one radius for every corner — verified: the note is now conditioned on the derived entry lacking the flag, with a test for both the card and a part that still takes one radius.
- Description: a physical corner longhand written after a logical one for the same corner leaves the logical variable set — verified: the compiler writes only the named corner for a longhand, so the reader keeps the logical value; the consequence is the non-blocking note above.
- Description: the vars-documented check counts a flagged entry's corner variables as documented, from one shared corner list — verified: the registry test derives both the documented set and the Breadcrumbs cross-component list from the shared helper, and passes.
- Description: the before and after Chromium measurements it reports — verified: each reported value matches this review's own measurements at the same stories.
- Description: seven new Chromium cases and the new compiler tests — verified: seven test blocks added to the container-corners spec and five new compiler cases plus the parser case; all unit suites pass at this head.
- Description: one new public type member and no other public API — verified: the API generator reports zero rows for Core and the seven themes; the only surface change is the optional authoring-type member.
- Description: the local run for this head passes — consistent with this review: this review ran the Core and docsite unit suites, the new CLI editor test, the knowledge and changeset checks and the Core typecheck at this head, all passing; the repository's Chromium spec was not executed here.
Files:
.changeset/theme-corners-reach-children.md— clear — every claim in it was checked (above).apps/docsite/scripts/generate-data.mjs— clear — adds the new field to the emitted interface, which the projection test pins.apps/docsite/scripts/lib/theming-doc.mjs— clear — field list matches the emitted interface; the projection test passes.apps/storybook/stories/ContainerCorners.stories.tsx— clear — seven stories that reach the changed code; they render in both trees and were used for this review's measurements.docs/specs/components/DropdownMenu/DropdownMenu.spec.md— clear — adds DEC-12 only; the record ends at DEC-11 on the default branch, no decider or approval line changes, and an engineering owner approved this head.packages/cli/api/theme-edit/_check.mjs— clear — the relaxed refusal still rejects a slash radius, and a malformed radius is caught earlier by the grammar check.packages/cli/api/theme-edit/_context.mjs— clear — type annotation only.packages/cli/api/theme-edit/_edit.mjs— clear — the single-radius note is now conditioned on the derived entry.packages/cli/api/theme-edit/_settings.mjs— clear — type annotation and comment.packages/cli/api/theme-edit/theme-corners-content-each-corner.test.mjs— clear — covers the card, a part that still takes one radius, and a menu radius of different corners; passes.packages/cli/authoring/doctypes/base/type.ts— clear — the optional member, with its doc comment now attached to it.packages/core/src/Breadcrumbs/BreadcrumbItem.tsx— clear — the overflow menu resets its corner variables.packages/core/src/Card/Card.doc.mjs— clear — the flag on both locales' entries.packages/core/src/Card/Card.tsx— clear — resets its corner variables and publishes through the shared corner reading; the nested-card case is measured.packages/core/src/ContextMenu/ContextMenu.doc.mjs— clear.packages/core/src/ContextMenu/ContextMenu.tsx— clear — both surfaces reset their corner variables.packages/core/src/Dialog/Dialog.doc.mjs— clear.packages/core/src/Dialog/Dialog.tsx— clear — the dialog and the inline wrapper reset, and the inner corners come from the shared reading.packages/core/src/DropdownMenu/DropdownMenu.doc.mjs— clear.packages/core/src/DropdownMenu/DropdownMenu.tsx— clear — the popover surface resets its corner variables.packages/core/src/DropdownMenu/DropdownMenuCheckboxItem.tsx— clear — row corners move to the shared style.packages/core/src/DropdownMenu/DropdownMenuItem.tsx— clear — row corners move to the shared style.packages/core/src/DropdownMenu/DropdownMenuRadioItem.tsx— clear — row corners move to the shared style.packages/core/src/DropdownMenu/DropdownMenuSubMenu.tsx— clear — the trigger row now uses the shared style, and the flyout and region surfaces reset; measured at this head.packages/core/src/DropdownMenu/menuRowCorners.stylex.ts— clear — one resolver for the four row kinds, with the right-to-left mapping; its separation from the container publication is explained and matches the current record.packages/core/src/Layout/__tests__/ContainerCorners.a11y.chromium.spec.ts— clear — seven cases whose expectations this review reproduced with its own probes.packages/core/src/Layout/containerCorners.stylex.ts— clear — the one place the corner is resolved for Card and Dialog; no reader of the old block-edge variables remains anywhere.packages/core/src/theme/derivedVarRegistry.test.ts— clear — counts the corner variables as documented from the shared list.packages/core/src/theme/derivedVarRegistry.ts— clear — the flag, the corner lists and the shared helper.packages/core/src/theme/generateThemeRules.test.ts— clear — five corner cases plus the parser's cases.packages/core/src/theme/generateThemeRules.ts— clear apart from the longhand-ordering note above; the corner map runs for the resting rule, pseudo-class blocks and colour-mode blocks.
| '--_card-radius': radiusVars['--radius-container'], | ||
| // Theme corner variables inherit. Reset them, so a nested surface that the | ||
| // theme does not style hands out its own radius. | ||
| '--_card-radius-top-left': 'initial', |
There was a problem hiding this comment.
Non-blocking: this eight-line reset is repeated in five files (Dialog.tsx:228 and :346, DropdownMenu.tsx:188, DropdownMenuSubMenu.tsx:212 and :326, ContextMenu.tsx:161 and :217, BreadcrumbItem.tsx:273). It follows the existing pattern of repeating --_dropdown-menu-radius and the padding at those same sites, so nothing is wrong here; the cost is that a surface added later and missing the block will hand a nested default surface its ancestor's corners. One exported style object per family of surfaces would make that impossible to forget.
- #12921 fix(Table): useTableSortableState sorts an Invalid Date like null instead of throwing Author: @josephfarina - #12911 perf(cli): read a project's lockfile only for an Astryx package it has not installed Author: @josephfarina - #12388 fix(core): a theme radius of different corners reaches what a Card, a Dialog and a menu hand each corner to Author: @josephfarina
|
Landed in #12945. |
User impact
A theme that gives a Card, a Dialog or a menu corners of different radii (
borderRadius: '12px 12px 0 0', a corner longhand such asborderStartStartRadius, or8px / 4px) draws the container right, but what the container hands its corners to does not follow (an elliptical corner reaches a full-bleed Table after this change; a List and menu rows subtract the padding from it, so they stay square there):calc()cannot read.Problem and solution fit
The container publishes one radius per block edge, taken from its single private radius variable. A radius of four corners has no single value, so every reader of that variable gets the wrong corner or an invalid value. The fix writes each corner to its own variable at compile time, where the four values are known, and has the readers take their own corner. A one-value radius writes the same corner everywhere, so a variant or state rule that sets one radius still overrides a base rule's corners.
Expected behavior and authority
architecture:container-padding(Corner geometry): a full-bleed child that reaches a rounded container's corner takes that corner; the container publishes one variable for each logical corner. This change makes each of those variables carry its own corner when a theme gives the corners different radii. For menus,component:DropdownMenuDEC-12: every pointer-menu row takes the menu's corner shape, less its padding.Smallest restoration
generateThemeRules: for a derivedborderRadiusentry withcorners: true, write<var>-top-left… from the shorthand or a physical longhand and<var>-start-start… from a logical longhand. A later radius in the block replaces an earlier one, and the shorthand leaves no logical corner (initial), as the cascade does on the element.corners: trueon card, dialog, dropdown-menu and context-menu (registry, the component docs, and the authoring type that describesderivedentries).:dir(rtl)mapping);containerCornerspublishes each corner from its own host variable.component:DropdownMenuDEC-12 records that every pointer-menu row takes the menu's shape; the touch sheet's list rows keep their own corners./radius is still refused there).corners.containerCorners.stylex.tsreads each corner from them, right-to-left included, in one place.architecture:container-paddingkeeps menus outside container geometry, so menu rows read the menu's own corner variables, less the menu padding, inmenuRowCorners.stylex.ts, not the container publication.cornersentry's corner variables as documented, from one corner list the theme pipeline shares.Evidence
card: {base: {borderRadius: '12px 12px 0 0'}}and a Table that fills the Card: the card draws 12 12 0 0, the table's scroll region 0 0 0 0 (Chromium).borderStartStartRadius: 20pxin a right-to-left page reaches the table's top-right corner. A muted variant withborderRadius: 4pxover that base draws 4 4 4 4 on both.dropdown-menuborderRadius: '0 0 12px 12px', rows highlighted:generateThemeRules.test.ts(corner variables, longhands, replacement, no variables without the flag, corner parsing) and seven new ContainerCorners Chromium cases (rounded top card, logical and physical corners in right-to-left, bottom-rounded dialog list, a default card inside a rounded one, every menu row kind under a bottom-rounded and a one-radius menu, and menu rows in a right-to-left page).Scope
Components: Card, Dialog, DropdownMenu, ContextMenu, Breadcrumbs (its overflow menu), Layout (container corners), theme compilation;
@astryxdesign/clitypeComponentThemingDerivedVar.corners(new member)ComponentThemingDerivedVar.corners, thecornersflag of the component-docderivedentry, besidereplaces. The corner variables are private.)Testing
getComputedStyle.ContainerCorners.a11y.chromium.spec.tsextended; runs in the a11y contract job.Writing rubric results
Record rubric (
docs/contributing/spec-writing.md) overDropdownMenu.spec.md(DEC-12):preflight: pass 41bff50 (skip-ci marker finding only)