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

Editor styles flip alignright and alignleft positioning #10665

Closed
laurelfulford opened this issue Oct 16, 2018 · 5 comments
Closed

Editor styles flip alignright and alignleft positioning #10665

laurelfulford opened this issue Oct 16, 2018 · 5 comments
Labels
CSS Styling Related to editor and front end styles, CSS-specific issues. Good First Issue An issue that's suitable for someone looking to contribute for the first time Internationalization (i18n) Issues or PRs related to internationalization efforts Needs Dev Ready for, and needs developer efforts [Type] Bug An existing feature does not function as intended
Milestone

Comments

@laurelfulford
Copy link
Contributor

Describe the bug
When using an RTL language (or an RTL testing plugin), the .alignleft class aligns right, and the .alignright class aligns left in the edit-blocks-rtl.css enqueued from Gutenberg.

To Reproduce
Steps to reproduce the behavior:

  1. Add a quote block to a post.
  2. Using the Advanced options, add the alignleft class.
  3. Confirm that the quote is aligned left in the editor preview.
  4. Switch the site to RTL (you can do this using a testing plugin like RTL Tester).

Expected behavior

The quote will stay left-aligned, to match the class name -- it shouldn't change when the language direction does.

Actual behavior

Both .alignleft and .alignright switch float directions - I'm guessing this is coming from automatically generated RTL styles.

Screenshots

Here's a quote block with the alignleft class, and the styles coming from edit-blocks-rtl.css that are aligning it right:

image

The theme in the above screenshot is Twenty Sixteen; I was also able to recreate this with the Gutenberg starter theme.

@designsimply designsimply added [Type] Bug An existing feature does not function as intended Internationalization (i18n) Issues or PRs related to internationalization efforts labels Oct 17, 2018
@designsimply
Copy link
Member

Related: #10663

@laurelfulford
Copy link
Contributor Author

I'm noticing this on the front-end too while working on the default themes. I haven't noticed it in all of them -- I suspect because the theme itself has styles that are overriding it -- but here's an example from Twenty Fourteen:

image

In the stylesheet /plugins/gutenberg/build/block-library/style-rtl.css, .wp-block-image.alignleft is being set to float right. It looks like a bit of a mess because the theme's RTL styles 'assume' that a left-aligned element will stay on the left.

@designsimply designsimply added the Needs Design Feedback Needs general design feedback. label Nov 16, 2018
@karmatosed karmatosed removed the Needs Design Feedback Needs general design feedback. label Nov 22, 2018
@karmatosed karmatosed added this to the WordPress 5.0.1 milestone Nov 22, 2018
@mtias mtias added the Good First Issue An issue that's suitable for someone looking to contribute for the first time label Nov 30, 2018
@gziolo gziolo added the Needs Dev Ready for, and needs developer efforts label Apr 10, 2019
@liloo2040
Copy link

Hi !

I am sorry, I have tried to replicate what you did and unfortunately, I don't have the same results as you.

Example : when I switch from ltr to rtl (with css - customized or in a css file), it works. When I do alignleft, it goes to right and the other way around too.

I hope that helped you a bit more.

@tellthemachines tellthemachines added the CSS Styling Related to editor and front end styles, CSS-specific issues. label Apr 23, 2020
@paaljoachim
Copy link
Contributor

Hey @laurelfulford Laurel and others it would be great with an update. To hear if this issue still has the same problem.
How can we move it forward?
Thanks!

@glendaviesnz
Copy link
Contributor

I wasn't able to replicate this on WP 5.8, Gutenberg 11.3 and TwentyTwentyOne theme:

Screen Shot 2021-08-26 at 5 45 56 PM

So closing for now, feel free to reopen @laurelfulford if you can still replicate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CSS Styling Related to editor and front end styles, CSS-specific issues. Good First Issue An issue that's suitable for someone looking to contribute for the first time Internationalization (i18n) Issues or PRs related to internationalization efforts Needs Dev Ready for, and needs developer efforts [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

No branches or pull requests