-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
refactor(@carbon/styles): use logical properties for better RTL support #14531
refactor(@carbon/styles): use logical properties for better RTL support #14531
Conversation
79c3b16
to
a24b733
Compare
✅ Deploy Preview for carbon-components-react ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
✅ Deploy Preview for carbon-elements ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
✅ Deploy Preview for carbon-components-react ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
✅ Deploy Preview for carbon-elements ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
@alisonjoseph anything that uses |
@tw15egan Agree this is already a huge PR. My only worry is that if teams are using RTL, and then we release this they will have broken components. I wonder if we could just keep this branch and open PR's to fix things into this branch, and then release all at once? |
Good point, I guess we should create a new branch and we can work off that until we can fix these issues |
6d573cd
to
7964324
Compare
@alisonjoseph this is now pointing to a new |
@tw15egan sounds good, lets merge it 👍 |
…rt (#14531) * refactor(styles): update styles to use CSS logical properties * fix(styles): change padding-inline-end to padding-inline * fix(styles): run stylelint --fix on components * fix(styles): run stylelint --fix on utilities * fix(Select): test padding fix * chore(stylelint): run styelint on files outside @carbon/styles * fix(AspectRatio): remove unsupported float: inline-start * fix(ContainedList): redefine tag tokens in contained list * fix(ContainedList): keep story the same
…rt (#14531) * refactor(styles): update styles to use CSS logical properties * fix(styles): change padding-inline-end to padding-inline * fix(styles): run stylelint --fix on components * fix(styles): run stylelint --fix on utilities * fix(Select): test padding fix * chore(stylelint): run styelint on files outside @carbon/styles * fix(AspectRatio): remove unsupported float: inline-start * fix(ContainedList): redefine tag tokens in contained list * fix(ContainedList): keep story the same
…upport (#14580) * refactor(@carbon/styles): use logical properties for better RTL support (#14531) * refactor(styles): update styles to use CSS logical properties * fix(styles): change padding-inline-end to padding-inline * fix(styles): run stylelint --fix on components * fix(styles): run stylelint --fix on utilities * fix(Select): test padding fix * chore(stylelint): run styelint on files outside @carbon/styles * fix(AspectRatio): remove unsupported float: inline-start * fix(ContainedList): redefine tag tokens in contained list * fix(ContainedList): keep story the same * [WIP] fix(components): fix RTL issues with components (#14546) * fix(components): fix RTL issues with components * style(components): more fixes for RTL styles * style(components): more fixes for RTL styles * fix(Popover): fix popover styles in RTL mode * fix(TreeView): fix RTL issues with TreeView * fix(Breadcrumb): fix small issue with overflow menu variant * fix(Popover): fix autoalign story issues * fix(menuButton): fix RTL issues with MenuButton (#14565) * fix(menuButton): fix RTL issues with MenuButton * fix(Menu): adjust caret rotation * refactor(menu): remove rtl override * fix(Menu): adjust story positioning, add CaretLeft for RTL mode * refactor(Menu): useLayoutContext to check if parent has direction set * style(React): fix linting issues with storybook styles * test(Accordion): update snapshots * fix(Tooltip): move border
* refactor(@carbon/styles): use logical properties for better RTL support (#14531) * refactor(styles): update styles to use CSS logical properties * fix(styles): change padding-inline-end to padding-inline * fix(styles): run stylelint --fix on components * fix(styles): run stylelint --fix on utilities * fix(Select): test padding fix * chore(stylelint): run styelint on files outside @carbon/styles * fix(AspectRatio): remove unsupported float: inline-start * fix(ContainedList): redefine tag tokens in contained list * fix(ContainedList): keep story the same * [WIP] fix(components): fix RTL issues with components (#14546) * fix(components): fix RTL issues with components * style(components): more fixes for RTL styles * style(components): more fixes for RTL styles * fix(Popover): fix popover styles in RTL mode * fix(TreeView): fix RTL issues with TreeView * fix(Breadcrumb): fix small issue with overflow menu variant * fix(Popover): fix autoalign story issues * fix(menuButton): fix RTL issues with MenuButton (#14565) * fix(menuButton): fix RTL issues with MenuButton * fix(Menu): adjust caret rotation * refactor(menu): remove rtl override * fix(Menu): adjust story positioning, add CaretLeft for RTL mode * refactor(Menu): useLayoutContext to check if parent has direction set * style(React): fix linting issues with storybook styles * test(Accordion): update snapshots * fix(Tooltip): move border * fix(components): fix a few more RTL issues with components * fix(Slider): adjust positioning logic when rtl mode is enabled * chore(test): remove console.log * test(Slider): update tests * fix(ProgressBar): reverse indeterminate animation in RTL mode
…upport (carbon-design-system#14580) * refactor(@carbon/styles): use logical properties for better RTL support (carbon-design-system#14531) * refactor(styles): update styles to use CSS logical properties * fix(styles): change padding-inline-end to padding-inline * fix(styles): run stylelint --fix on components * fix(styles): run stylelint --fix on utilities * fix(Select): test padding fix * chore(stylelint): run styelint on files outside @carbon/styles * fix(AspectRatio): remove unsupported float: inline-start * fix(ContainedList): redefine tag tokens in contained list * fix(ContainedList): keep story the same * [WIP] fix(components): fix RTL issues with components (carbon-design-system#14546) * fix(components): fix RTL issues with components * style(components): more fixes for RTL styles * style(components): more fixes for RTL styles * fix(Popover): fix popover styles in RTL mode * fix(TreeView): fix RTL issues with TreeView * fix(Breadcrumb): fix small issue with overflow menu variant * fix(Popover): fix autoalign story issues * fix(menuButton): fix RTL issues with MenuButton (carbon-design-system#14565) * fix(menuButton): fix RTL issues with MenuButton * fix(Menu): adjust caret rotation * refactor(menu): remove rtl override * fix(Menu): adjust story positioning, add CaretLeft for RTL mode * refactor(Menu): useLayoutContext to check if parent has direction set * style(React): fix linting issues with storybook styles * test(Accordion): update snapshots * fix(Tooltip): move border
…em#14635) * refactor(@carbon/styles): use logical properties for better RTL support (carbon-design-system#14531) * refactor(styles): update styles to use CSS logical properties * fix(styles): change padding-inline-end to padding-inline * fix(styles): run stylelint --fix on components * fix(styles): run stylelint --fix on utilities * fix(Select): test padding fix * chore(stylelint): run styelint on files outside @carbon/styles * fix(AspectRatio): remove unsupported float: inline-start * fix(ContainedList): redefine tag tokens in contained list * fix(ContainedList): keep story the same * [WIP] fix(components): fix RTL issues with components (carbon-design-system#14546) * fix(components): fix RTL issues with components * style(components): more fixes for RTL styles * style(components): more fixes for RTL styles * fix(Popover): fix popover styles in RTL mode * fix(TreeView): fix RTL issues with TreeView * fix(Breadcrumb): fix small issue with overflow menu variant * fix(Popover): fix autoalign story issues * fix(menuButton): fix RTL issues with MenuButton (carbon-design-system#14565) * fix(menuButton): fix RTL issues with MenuButton * fix(Menu): adjust caret rotation * refactor(menu): remove rtl override * fix(Menu): adjust story positioning, add CaretLeft for RTL mode * refactor(Menu): useLayoutContext to check if parent has direction set * style(React): fix linting issues with storybook styles * test(Accordion): update snapshots * fix(Tooltip): move border * fix(components): fix a few more RTL issues with components * fix(Slider): adjust positioning logic when rtl mode is enabled * chore(test): remove console.log * test(Slider): update tests * fix(ProgressBar): reverse indeterminate animation in RTL mode
Closes #13619
Updates the repo to use CSS Logical Properties. This will help users render the components in RTL mode without the need for post-processors like RTLCSS
Changelog
New
stylelint-use-logical
added tostylelint-config-carbon
Changed
left
,right
,top
, etc...Testing / Reviewing
Ensure there are no visual regressions. Select
rtl
via theText direction
dropdown via storybook and ensure components render as expected.I have encountered one issue with
Popover
, which we can address in a separate PR. Since we usebottom-right
,top-left
etc, these styles are broken when RTL mode is enabled