-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Add automated RTL support #3844
Conversation
We're going to autogenerate RTL css files, so this won't be needed
This currently loads the version from https://github.com/yoavf/webpack-rtl-plugin/tree/develop This include a simple (but required) change, that's been requested upstream as a PR: romainberger/webpack-rtl-plugin#15
This is done by adding style data - WP will automatically load the -rtl css files instead of the regular files in RTL mode.
Whoa what serendipitous timing! CC @youknowriad 😉 |
Ha @jasmussen - I got started with this at WC US, and missed #3831 before pushing. I think this method is preferable, since we don't end up with big LTR and RTL css files, and we use WP's built in style loading for RTL. If there's ever a decision to switch to having the CSS inline, then using postcss makes more sense. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work here! This approach is better indeed. We should also copy the "arrow icon" inverting from the other PR.
gutenberg.php
Outdated
@@ -484,7 +488,11 @@ function gutenberg_replace_default_add_new_button() { | |||
display: block; | |||
top: 0; | |||
margin: -1px 0; | |||
<?php if ( is_rtl() ) : ?> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just wondering about the indentation here, should it be aligned with the styling (like above) or not? We should probably be consistent anyway.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 will fix
This is absolutely the better approach! Thanks Yoav. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
❤️
Awesome work |
Description
The current RTL experience with Gutenberg is broken, and there's no reason to try and maintain RTL css manually.
This adds automated generation of RTL CSS files using rtlcss via a slightly modified webpack-rtl-plugin. The modification to the plugin are described in this PR.
It also adds minor fixes for the new post button inline css.
How Has This Been Tested?
Confirmed that:
npm run build
will also build-rtl.css
files.Screenshots (jpeg or gifs if applicable):
Before:


After:
Types of changes
Bug fix for current RTL CSS
Checklist: