-
Notifications
You must be signed in to change notification settings - Fork 221
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
Support Bidirectionality #278
Comments
Awesome work putting this together @stephanerangaya! Is there ever a case where some components would be RTL and others not? I'm wondering if we should provide this from a higher order component rather than needing to pass the prop to every single component. We could build this into the import * as React from 'react';
import {CanvasProvider} from '@workday/canvas-kit-react';
<CanvasProvider isRTL={true}>
{/* All your components containing any Canvas components */}
</CanvasProvider>; This flag would then be available to all components within the |
Yes, there are cases where some components would be RTL and some not. For example, if you have a progress bar that show an audio track, it wouldn't be RTL but LTR, but if it shows the space you use on your data plan, it should be RTL, even though technically it is the same underlaying component. But maybe we could compose using CanvasProvider by nesting them? |
Ah, good point. Yeah that's how we do custom themes for a given component |
Not supported with all browsers yet but it is nonetheless an interesting tag, we should use it when it makes sense https://developer.mozilla.org/en-US/docs/Web/HTML/Element/bdi |
It looks like adding The |
🚀 Feature Proposal
Canvas Kit components need to support both Right-to-Left and Left-to-Right writing systems. This issue aims to centralize the work we will need to do to support bidirectionality.
For now, we're only looking at React components that are not in Labs, but we should discuss about the way we handle CSS before we start the work on React components.
Questions:
isRTL
, so probably keep doing thisIconButton
with aBack
Icon, should we do:or (my personal preference)
or
Facts:
Components
Action Bar
In RTL, the elements should be align to the right. The order of the elements in the bar should be reversed.
Avatar
This component supports bidirectionality out of the box.
Banner
In RTL, the order of the elements in the banner should be reversed. We should update to documentation to also recommend flipping the placement of the
sticky
Banner to the other side of the screen when in RTL.Button
Card
In RTL, the alignement should change.
Common
This component supports bidirectionality out of the box.
Cookie Banner
In RTL, the order of the elements in the banner should be reversed.
Core
This component supports bidirectionality out of the box.
Form Field
Icon
We should allow an isRTL icon, for when the Icon direction should change depending on the text direction.
Layout
This component supports bidirectionality out of the box.
Loading Animation
This component supports bidirectionality out of the box.
Note: because a loading animation is showing basically showing progress over time and time is going forward, progress bars and loading animation are not reversed (same if we were building a Podcast player app, the progress would go the same direction, and the Play icon would also be the same direction).
Therefore, it makes sense to keep the dots animating at they are for all languages.
Modal & Popup
In RTL, the order of the elements in the main container should be reversed. The CTA should be on the right, the close icon should be on the left.
Page Header
In RTL, the order of the elements in the main container should be reversed.
Side Panel
In RTL, the Expand/Collapse icon should be on the left and flipped.
Sketelon
This component supports bidirectionality out of the box, but
Complete
should be flipped.Status Indicator
In RTL, the order of the elements in the main container should be reversed.
Table
In RTL, the order of the columns should be reversed.
Toast
In RTL, the order of the elements in the main container should be reversed.
Tooltip
This component supports bidirectionality out of the box.
The text was updated successfully, but these errors were encountered: