Skip to content

refactor(remix)!: one spelling per styler operation - #132

Merged
leoafarias merged 12 commits into
mainfrom
leoafarias/nicosia
Aug 12, 2026
Merged

refactor(remix)!: one spelling per styler operation#132
leoafarias merged 12 commits into
mainfrom
leoafarias/nicosia

Conversation

@leoafarias

@leoafarias leoafarias commented Aug 11, 2026

Copy link
Copy Markdown
Member

Makes Remix stylers expose one spelling per operation: generated canonical primitives plus Dart dot shorthand, without handwritten aliases that duplicate them.

Removed duplication

  • Removes the 68-method RemixBoxStylerConvenience layer (paddingAll, borderRadiusTop, marginX, borderAll, shapeCircle, and related aliases).
  • Removes 42 component aliases across 24 components, including duplicated backgroundColor, flex, foregroundColor, square, sizeWH, and modifier helpers.
  • Keeps slot-forwarding conveniences such as titleColor, labelFontSize, and leadingIconSize; those name child slots that have no equivalent parent primitive.
  • Deletes four extensions left empty by the migration.

Representative replacements:

Retired Canonical
.paddingAll(16) .padding(.all(16))
.paddingX(8) .padding(.horizontal(8))
.borderRadiusAll(r) .borderRadius(.all(r))
.borderRounded(12) .borderRadius(.circular(12))
.borderAll(color: c, width: w) .border(.color(c).width(w))
.sizeWH(w, h) .size(w, h)

Optional BorderSideMix fields still use its constructor; chained setters are only used when values are non-null.

RemixBoxEffectsMix and .create()

RemixBoxEffectsMix gains matching named factories and chainable methods for backdrop blur, outline, outline offset, and the behind/over-content layers.

.create() remains the raw Prop layer. In particular, the dialog's context-resolved viewport insets require PaddingModifierMix.create(padding: Prop.token(...)): the friendly Mix modifier API has no whole-EdgeInsetsGeometry token parameter. This is correct and load-bearing, not a Remix workaround or merge blocker. A future Mix ergonomic API could shorten that one call site, but no upstream fix is required for these PRs.

Enforcement

tool/validate_docs.dart now rejects retired forms across docs, app/example sources, package libraries, consumer Markdown, and workspace tests. Test scanning matters because Mix still exposes some of the old convenience spellings, so those calls compile and cannot be left to the analyzer alone.

The newly merged chart gallery exposed the intended value of that rule: five new retired calls were migrated immediately, and one stale wrapper comment was corrected. Current branch validation covers 32 MDX files, 117 Dart snippets, 125 app/example sources, 170 package library sources, 155 test sources, and 12 consumer Markdown files.

Verification

  • Branch analyzer: clean
  • Docs/canonical API validator: passed
  • Fresh trial merge in order #130 → #133 → #132: analyzer clean and full CI green
  • Combined tree: 27 Remix + 29 Fortal generated artifacts reproduced byte-for-byte; 33 MDX files / 123 Dart snippets / 168 library files / 155 test files; 30 mapped families; Remix 2,568 · Fortal 360 · dashboard 46 · demo 1 tests

Review and integration notes

Remix stylers now offer one way to express a style: the canonical primitive plus
Dart dot shorthand. The convenience layer that duplicated it is gone.

`RemixBoxStylerConvenience` carried 68 methods — paddingAll, borderRadiusTop,
borderAll, marginX, shapeCircle and the rest — each a one-line forward to the
primitive already declared on `RemixBoxStylerAnchors`. Every call site moves to
`padding(.all(x))`, `borderRadius(.circular(x))`, `border(.top(...))`, and their
siblings, which is the form the Mix styler policy documents and the only form
that also expresses mixed corners and directional insets.

The chained BorderSideMix setters take non-nullable values, so the handful of
wrappers that forward optional color, width, style, and strokeAlign keep the
compound primitive with the constructor inside rather than forcing a default.

RemixBoxEffectsMix gains named factories and matching chainable instance methods
for backdropBlur, outline, outlineOffset, behindContent, and overContent, so
`containerEffects(.backdropBlur(64).outlineOffset(2))` reads as one value. The
raw `.create()` constructor is untouched: it takes Props directly, which is what
widget internals and the dialog's context-resolved viewport insets need.

tool/validate_docs.dart rejects the retired forms and now also scans
packages/*/lib, which it previously skipped entirely.

BREAKING CHANGE: RemixBoxStylerConvenience and its 68 extension methods are
removed from the public API. Replace `paddingAll(x)` with `padding(.all(x))`,
`borderRadiusAll(r)` with `borderRadius(.all(r))`, `borderAll(color: c)` with
`border(.all(.color(c)))`, and the same pattern for the margin, shape, shadow,
and constraints helpers.
`BoxBorderMix.color(v)` is defined as `BorderMix.all(BorderSideMix.color(v))`,
so a border identical on every side needs no `.all(...)` around a side the
shorthand builds anyway. 23 call sites lose the wrapper.

`.all(...)` stays where it earns its place: a specific side, a prebuilt side,
and — the case that matters here — forwarding optional values, since the chained
setters take non-nullable arguments. `fortalFocusRing` keeps the constructor
form for exactly that reason: tabs pass `strokeAlign: null` deliberately to let
`BorderSide` supply its own default, which `.strokeAlign(double)` cannot express.

Documented upstream in conceptadev/mix#1018 so the styler policy and this
codebase agree.
Every handwritten helper that re-spelled an operation the generated
surface already exposes is gone. A canonical operation now has exactly
one spelling.

ButtonStyler and IconButtonStyler lose their last 12 helpers, including
modifierRotate, whose body was literally wrap(.rotate(...)). Twenty-two
other components lose the same aliases they carried: backgroundColor,
foregroundColor, flex, square, and sizeWH.

Every generated color() was verified to target the identical slot its
alias did, including AccordionStyler.color, which forwards to trigger
rather than a root container.

Call sites were migrated from analyzer output rather than by textual
rename: Mix's own TextStyler.backgroundColor sets the text background,
not the foreground, so a blind rename would have silently changed
behavior at those sites.

Four extensions left empty by the removal are deleted.

Also re-vendors the mix skill, which now documents that a uniform border
skips the side wrapper.
@leoafarias leoafarias changed the title refactor(remix)!: expose canonical styler primitives refactor(remix)!: one spelling per styler operation Aug 11, 2026
# Conflicts:
#	apps/dashboard/lib/shell/sidebar.dart
# Conflicts:
#	apps/demo/lib/components/accordion.dart
#	docs/components/accordion.mdx
#	packages/remix/example/api/accordion.0.dart
#	packages/remix_fortal/lib/src/recipes/accordion.dart
…llings

The accordion panel container arrived after this branch migrated its call
sites, so its documentation and API example still used the retired padding
and border-radius conveniences. The validator on this branch is what caught
them.
@leoafarias
leoafarias merged commit e5e4491 into main Aug 12, 2026
3 checks passed
@leoafarias
leoafarias deleted the leoafarias/nicosia branch August 12, 2026 17:10
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