-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
feat(theme): add rtlcss directive #1512
Conversation
I can add that, but I don't think it will be necessary as the current implementation (i18n-next) already allows overriding
in your config you can override Regarding your PR, I don't have much experience, |
"K⌘" in the search bar should be "⌘K" (on macOS). The same for other operating systems. I didn't see any other obvious problems, but I think it would be useful to have an Arabic/Hebrew/etc.-speaking expert double-check the page and/or the code. |
I'm merging this with i18n(-next) branch for now. We can tackle other issues directly on #1339. Regarding documenting both ltr and rtl in the same app, there will be some issues as the styles will be shared, so if you add the rtlcss postcss plugin, the styles for ltr pages will also change. |
Regarding this, I wanted to ask are you using override mode in |
Hi,
/* before */
body {
direction: ltr;
}
/* after */
body {
direction: rtl;
} but
/* before */
body {
direction: ltr;
}
/* after */
body {
direction: ltr;
}
[dir="rtl"] body {
direction: rtl;
} |
I didn't check the vitepress node folder completely vitepress/src/node/build/render.ts Lines 103 to 105 in 12ca9dd
When you are using rtlcss you have to generate CSS two times (.vitepress/dist/assets) , one for ltr without any rtlcss proccess (style.********.css) and another with rtlcss (style-rtl.********.css)
since
|
Ah, right. I was actually looking at the docs of https://www.npmjs.com/package/postcss-rtlcss
Yeah, that's what I was thinking.
I can make it work, but it will need a full page reload for styles to apply. |
Ow you're right I thought it would work I think CSS Logical Properties is the propper way to achieve i18n goal then, however support table is colorful 😵 |
On second thoughts, we can use |
https://vitepress-rtlcss.vercel.app/
This is just simple rtlcss directive
Still requires to User to add
rtlcss
as theirdevDependencies
and use it invitepress
config,Because it has not been implemented in
node
folderI saw i18n and i18n-next branch for handling
dir
andlang
options and other feats,If you add
dir
frontmatter would be so good, documentation sites support both RTL and LTR at the same timepage-rtl.md
page-ltr.md