feat(ui): migrate Mosaic Icon to StyleX#9245
Open
alexcarpenter wants to merge 2 commits into
Open
feat(ui): migrate Mosaic Icon to StyleX#9245alexcarpenter wants to merge 2 commits into
alexcarpenter wants to merge 2 commits into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
🦋 Changeset detectedLatest commit: 3643f2a The changes in this PR will be included in the next version bump. This PR includes changesets to release 0 packagesWhen changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Same contract as the other migrated components: a stable `.cl-icon` class plus a `data-size` attr, with the consumer's `className`/`style` merged last. The `appearance.icons` override path loses a layer. It only wrapped itself in Emotion's `ClassNames` to serialize the recipe's `css` into a real class, since an override authored in a consumer file has no jsx pragma to process a `css` prop. `stylex.props()` already returns a className, so the override is now cloned directly with the same merged props the built-in glyph gets.
alexcarpenter
force-pushed
the
carp/mosaic-icon-stylex
branch
from
July 24, 2026 20:20
7f6ce20 to
3643f2a
Compare
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.
Description
Moves
Iconoff the Emotion slot-recipe engine onto StyleX. Same contract as the components migrated before it: a stable.cl-iconclass plus adata-sizeattribute, with the consumer'sclassName/stylemerged last.The
appearance.iconsoverride path loses a layer. It only wrapped itself in Emotion'sClassNamesto serialize the recipe'scssinto a real class — an override is authored in a consumer file with no jsx pragma, so its owncssprop would be ignored.stylex.props()already returns a className, so the override is now cloned with the same merged props the built-in glyph gets:Everything the override path guaranteed is unchanged: overrides stay plain elements (so they serialize across the RSC boundary), Mosaic's sizing applies to them exactly as to the built-in glyph, the element's own
classNamesurvives, call-site svg props are forwarded, andrefis still deliberately not forwarded to an override.Consumers target
.cl-icon+data-sizeinstead ofdata-cl-slot="icon"andappearance.elements.icon, matching Button, Heading, and Text.Checklist
pnpm testruns as expected.pnpm buildruns as expected.Type of change