-
Notifications
You must be signed in to change notification settings - Fork 202
feat: remove dir polyfill [CSS-222] #4014
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: spectrum-two
Are you sure you want to change the base?
feat: remove dir polyfill [CSS-222] #4014
Conversation
🦋 Changeset detectedLatest commit: 6e05e55 The changes in this PR will be included in the next version bump. This PR includes changesets to release 24 packages
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 |
File metricsSummaryTotal size: 1.42 MB*
File change detailsaccordion
actionbutton
assetlist
breadcrumb
calendar
colorarea
colorloupe
colorslider
colorwheel
combobox
menu
pagination
popover
progressbar
radio
slider
steplist
switch
table
tabs
tooltip
treeview
* An ASCII character in UTF-8 is 8 bits or 1 byte. |
📚 Branch previewPR #4014 has been deployed to Azure Blob Storage: https://spectrumcss.z13.web.core.windows.net/pr-4014/index.html. |
Manual VRT compare: https://www.chromatic.com/review?appId=64762974a45b8bc5ca1705a2&number=35&type=unlinked&view=activity It uncovered only 1 diff which seems to have just been a test blip off spectrum-two's last baseline. |
cfaca84
to
9b639c3
Compare
9b639c3
to
6e05e55
Compare
Description
This PR removes the
dir
attribute polyfill (served via a PostCSS transform to compiled assets) as the fallback is no longer necessary. Thedir
attribute support is available in all supported browsers and has been tested to correctly inherit inside web component shadow DOMs.Breaking change: This is a breaking change only to those relying on the
dir
attribute being present for styling, however, the:dir
pseudo will correctly inherit values from their containers. To correctly determine thedir
value of a node using JavaScript, you can usegetComputedStyle(node).direction
.Components affected: This change affects 22 components that previously relied on the
dir
polyfill:Technical changes:
"dir-pseudo-class": { preserve: true }
from PostCSS config--tag next
for comparison[dir="rtl"]
selectorsHow and where has this been tested?
Please tag yourself on the tests you've marked complete to confirm the tests have been run by someone other than the author.
Validation steps
Test RTL layout in accordion component:
Test RTL layout in breadcrumb component:
Test RTL layout in calendar component:
Test RTL layout in pagination component:
Test RTL layout in tabs component:
Test that
getComputedStyle(node).direction
returns correct values:dir="ltr"
anddir="rtl"
attributesgetComputedStyle(node).direction
returns "ltr" and "rtl" respectivelyRun component comparison:
yarn component:compare
to verify changes against published versions[dir="rtl"]
selectors were removed:dir(rtl)
selectors remain intactRegression testing
Validate:
Screenshots
No visual changes expected - this is a technical cleanup removing polyfill code that is no longer needed.
To-do list