Skip to content

chore(icons): centralize rtl handling for icons in swc-ui-icon - #6579

Open
cdransf wants to merge 1 commit into
cdransf/2nd-gen-icon-public-workflowfrom
cdransf/2nd-gen-icon-rtl
Open

chore(icons): centralize rtl handling for icons in swc-ui-icon#6579
cdransf wants to merge 1 commit into
cdransf/2nd-gen-icon-public-workflowfrom
cdransf/2nd-gen-icon-rtl

Conversation

@cdransf

@cdransf cdransf commented Aug 4, 2026

Copy link
Copy Markdown
Member

Description

Moves chevron/arrow RTL mirroring into <swc-ui-icon> itself (new ui-icon-direction.css, curated chevron/arrow list, icon now reflect: true). Removes accordion-item.css's now-redundant mirror rule (kept its RTL+open rotation compensation, which is genuinely Accordion-specific). Adds 5 tests covering direct + inherited dir, both curated icons, and non-directional exclusion. Note: :host(:dir(rtl))[icon="x"] silently fails to match in Chromium; both conditions must be inside :host()'s own argument (:host(:dir(rtl)[icon="x"])), documented in the CSS.

Motivation and context

RFC icon-rfc.md section 11 (resolved): mirror directional UI icons via :dir(rtl) in the UI icon stylesheet, owned by <swc-ui-icon>, not components.

Related issue(s)

  • Jira: SWC-2440

Screenshots (if appropriate)

None. Accordion's VRT snapshot (covers RTL) is byte-identical before/after.

Author's checklist

  • I have read the CONTRIBUTING and PULL_REQUESTS documents.
  • I have reviewed the Accessibility Practices for this feature.
  • I have added automated tests to cover my changes.
  • I have included a well-written changeset if my change needs to be published.
  • I have included updated documentation if my change required it.

Reviewer's checklist

  • Includes a Github Issue with appropriate flag or Jira ticket number without a link
  • Includes thoughtfully written changeset if changes suggested include patch, minor, or major features
  • Automated tests cover all use cases and follow best practices for writing
  • Validated on all supported browsers
  • All VRTs are approved before the author can update Golden Hash

Manual review test cases

  • Storybook, any component with a chevron/arrow swc-ui-icon (e.g. Accordion): flip page dir to rtl, confirm it mirrors; flip back, confirm it un-mirrors.
  • Confirm a non-directional icon (e.g. checkmark) never mirrors under RTL.

Device review

  • Did it pass in Desktop?
  • Did it pass in (emulated) Mobile?
  • Did it pass in (emulated) iPad?

Accessibility testing checklist

  • Keyboard: N/A, visual-only change, no new interactive elements.
  • Screen reader: N/A. IconBase's existing host-owned a11y (decorative by default, role="img" when labeled) is untouched; the icon's own inner SVG was already never announced.

@cdransf cdransf self-assigned this Aug 4, 2026
@cdransf
cdransf requested a review from a team as a code owner August 4, 2026 17:39
@cdransf cdransf added the Spectrum 2 Issues related to Spectrum 2 label Aug 4, 2026
@changeset-bot

changeset-bot Bot commented Aug 4, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 9447838

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@cdransf
cdransf force-pushed the cdransf/2nd-gen-icon-rtl branch from d68ef6c to 6be2d79 Compare August 4, 2026 17:40
@github-actions

github-actions Bot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

📚 Branch Preview Links

🔍 Gen1 Visual Regression Test Results

When a visual regression test fails (or has previously failed while working on this branch), its results can be found in the following URLs:

Deployed to Azure Blob Storage: pr-6579

If the changes are expected, update the current_golden_images_cache hash in the circleci config to accept the new images. Instructions are included in that file.
If the changes are unexpected, you can investigate the cause of the differences and update the code accordingly.

@cdransf
cdransf force-pushed the cdransf/2nd-gen-icon-rtl branch from 3072ee4 to 9447838 Compare August 6, 2026 17:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Spectrum 2 Issues related to Spectrum 2

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant