Skip to content
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

a11y: right-to-left improvements #6235

Merged
merged 12 commits into from
Jan 4, 2023

Conversation

PeerRich
Copy link
Member

@PeerRich PeerRich commented Jan 2, 2023

to test, change dir="rtl"

CleanShot 2023-01-02 at 15 57 48@2x

CleanShot.2023-01-02.at.15.26.06.mp4

@PeerRich PeerRich linked an issue Jan 2, 2023 that may be closed by this pull request
@linear
Copy link

linear bot commented Jan 2, 2023

CAL-653 investigate rtl layout issues

and use ltr:ml-4 rtl:mr-4 etc.

@vercel
Copy link

vercel bot commented Jan 2, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
cal ✅ Ready (Inspect) Visit Preview Jan 3, 2023 at 10:15PM (UTC)

Comment on lines -113 to +129
<div>
<Label htmlFor="username">{t("username")}</Label>
</div>
<div className="mt-2 flex rounded-md">
<span
className={classNames(
"inline-flex items-center rounded-l-md border border-r-0 border-gray-300 bg-gray-50 px-3 text-sm text-gray-500"
)}>
{process.env.NEXT_PUBLIC_WEBSITE_URL.replace("https://", "").replace("https://", "")}/
</span>
<div className="relative w-full">
<Input
<TextField
ref={usernameRef}
name="username"
value={inputUsernameValue}
addOnLeading={
<>{process.env.NEXT_PUBLIC_WEBSITE_URL.replace("https://", "").replace("https://", "")}/</>
}
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

replaced Input with Textfield

this needs to be tested

@PeerRich PeerRich marked this pull request as ready for review January 2, 2023 14:57
@PeerRich PeerRich removed ♻️ autoupdate tells kodiak to keep this branch up-to-date automerge labels Jan 2, 2023
@PeerRich
Copy link
Member Author

PeerRich commented Jan 2, 2023

@Udit-takkar can you test both rtl and ltr on the vercel preview? also worth having the current main branch on another browser tab to compare. hopefully ltr is identical. if not I made a mistake

@PeerRich PeerRich requested a review from a team January 3, 2023 15:47
@JeroenReumkens
Copy link
Contributor

If we want to start doing this I think it's good if we communicate with everyone that they should take this into account. Otherwise we'll soon have a situation where this partially works, but breaks for new functionality. What do you think?

Besides that, Tailwind will soon (finally 😬) add support for margin-inline-start and -end. That's actually a more modern way to do this. If you use that instead of margin left/right, it will automatically be added on left/right side based on whether the user has rtl enabled. So that means you don't need to define the margin twice (for ltr and rtl). See tailwindlabs/tailwindcss#10166

I know you've already done a bunch of work looking at the PR, but maybe it's worth it to wait for this change to get merged soon?

Copy link
Contributor

@JeroenReumkens JeroenReumkens left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Checked the code, apart from 2 small questions that looks good.
So if we decide to go with this, instead of wait for tailwindlabs/tailwindcss#10166, then only Udit needs to test the website on preview and we're good to go in my opinion :)

cc @PeerRich

@@ -282,7 +282,7 @@ function UserDropdown({ small }: { small?: boolean }) {
</span>
</span>
<Icon.FiMoreVertical
className="h-4 w-4 flex-shrink-0 text-gray-400 group-hover:text-gray-500 rtl:mr-2"
className="h-4 w-4 flex-shrink-0 text-gray-400 group-hover:text-gray-500 ltr:mr-2 rtl:ml-2 rtl:mr-4"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it correct that on ltr it only has a margin on right side, and on rtl it has a margin on both sides?

@@ -50,15 +50,17 @@ const VerticalTabItem = function ({
props.textClassNames || "text-sm font-medium leading-none text-gray-600",
"min-h-9 group flex w-64 flex-row items-center rounded-md px-2 py-[10px] hover:bg-gray-100 group-hover:text-gray-700 [&[aria-current='page']]:bg-gray-200 [&[aria-current='page']]:text-gray-900",
props.disabled && "pointer-events-none !opacity-30",
(isChild || !props.icon) && "ml-7 mr-5 w-auto",
(isChild || !props.icon) && "ml-7 w-auto ltr:mr-5 rtl:ml-5",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's still a ml here, should that be removed?

@kodiakhq kodiakhq bot merged commit 45d10a3 into main Jan 4, 2023
@kodiakhq kodiakhq bot deleted the 6195-cal-653-investigate-rtl-layout-issues branch January 4, 2023 07:38
@JeroenReumkens JeroenReumkens restored the 6195-cal-653-investigate-rtl-layout-issues branch January 4, 2023 07:42
JeroenReumkens added a commit that referenced this pull request Jan 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
automerge ♻️ autoupdate tells kodiak to keep this branch up-to-date
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[CAL-653] investigate rtl layout issues
3 participants