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

Code block: set LTR direction for RTL languages #65891

Merged
merged 4 commits into from
Oct 14, 2024

Conversation

sabernhardt
Copy link
Contributor

Fixes #65890

Testing Instructions

  1. Set your site language to a right-to-left language (and set your profile language to match the site).
  2. Go to the post editor.
  3. Add a Code block and insert some code.
  4. Save changes.
  5. View the direction and alignment both in the editor and on the front.

@sabernhardt sabernhardt requested a review from ajitbohra as a code owner October 5, 2024 16:31
Copy link

github-actions bot commented Oct 5, 2024

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: sabernhardt <[email protected]>
Co-authored-by: t-hamano <[email protected]>
Co-authored-by: ankitpanchal75 <[email protected]>
Co-authored-by: torounit <[email protected]>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@sabernhardt
Copy link
Contributor Author

In addition to the ltr direction, the block seems to need left text alignment. WordPress admin CSS adds unicode-bidi: embed without the text alignment, but I did not notice a need for that property with the one code example.

Note that if your active theme is a classic theme, the admin CSS could affect code display within the post editor.

Copy link
Contributor

@t-hamano t-hamano left a comment

Choose a reason for hiding this comment

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

Thanks for the PR! Similar styles exist for the HTML block too, and I think this PR makes sense.

packages/block-library/src/code/editor.scss Outdated Show resolved Hide resolved
packages/block-library/src/code/style.scss Outdated Show resolved Hide resolved
@torounit torounit added [Type] Bug An existing feature does not function as intended [Block] Code Affects the Code Block labels Oct 11, 2024
Copy link
Contributor

@t-hamano t-hamano left a comment

Choose a reason for hiding this comment

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

LGTM 👍

@t-hamano t-hamano merged commit 7ca5790 into WordPress:trunk Oct 14, 2024
68 of 69 checks passed
@github-actions github-actions bot added this to the Gutenberg 19.5 milestone Oct 14, 2024
ciampo pushed a commit that referenced this pull request Oct 14, 2024
* style.scss direction and alignment

* editor.scss direction and alignment

* Revert changes to `editor.scss`

* Switch `left` to `initial` and add comment

Co-authored-by: sabernhardt <[email protected]>
Co-authored-by: t-hamano <[email protected]>
Co-authored-by: ankitpanchal75 <[email protected]>
Co-authored-by: torounit <[email protected]>
karthick-murugan pushed a commit to karthick-murugan/gutenberg that referenced this pull request Nov 13, 2024
* style.scss direction and alignment

* editor.scss direction and alignment

* Revert changes to `editor.scss`

* Switch `left` to `initial` and add comment

Co-authored-by: sabernhardt <[email protected]>
Co-authored-by: t-hamano <[email protected]>
Co-authored-by: ankitpanchal75 <[email protected]>
Co-authored-by: torounit <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Code Affects the Code Block [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Code block: fix direction for RTL languages
4 participants