-
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 Typography: text orientation (writing mode) #50822
Conversation
Size Change: +473 B (0%) Total Size: 1.44 MB
ℹ️ View Unchanged
|
Flaky tests detected in 332fc1c. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/5307911851
|
I think I got the two terms text-orientation and writing-mode confused. Do I need to rename this block support to writingMode, but keep the "Orientation" label for the control? |
This is great! Thank you for working on it. I will give it a review as soon as I have a moment. For the mean time, CC: @WordPress/gutenberg-design A quick thought: the writing-mode and text-orientation CSS properties I agree are a bit confusing. I would personally be okay with not adhering to those, and simply calling this "Orientation". Not a strong opinion. |
I think the writing-mode and the text-orientation would need to be two separate block supports but I will think some more about it and test a few things with the style engine. |
This looks neat, thanks for working on it. I think it might be worth trying the icons from the original issue, if not too much trouble. The |
Very neat! I'm wondering whether a more generic transform rotate setting (which looks like was explored previously) would be more valuable if the purpose behind this work is mainly for design tool reasons? Putting it another way, if we ever release a rotate setting (which other design tools have), how would that overlap with the function of typography orientation? |
I did not know there were more than one issue and a pull request, would have saved me some time if I would just have copied it 🤣 Reading from the discussion, there seems to be less support for a rotation setting. |
Can I copy those icons from Figma to the icon library? I did not find a link to the prototype in the issue. |
My apologies, the Figma is here, and here are SVG icons you can add to the library. text-vertical:
text-horizontal:
|
There's also #20926. @jasmussen can we consolidate all the issues and close them? |
Yep, I closed that one in favor of what this PR solves. |
The code here works super well, the feature has its prominence balanced through the ellipsis menu, and it's a really nice design tool. I broadened the ping range a bit as I'd love to see this land in 6.3. |
@jasmussen the code looks great - adds another piece, does nor introduce potential future legacy issues. Do you want to hold back on merging, because of doubts about the usefulness? |
No, I'm super antsy to get this in, I just don't want to press the green button on behalf of anyone :) |
Merged 👍 |
🚀 Thanks for working on this! |
Adds support for vertical text-orientation in paragraphs. See: WordPress/gutenberg#50822
Can we also support bottom up direction? |
* Add Typography: text orientation (writing mode) * fix spacing CS issues * try to fix white space issue * Rename text orientation to writing mode * Add new text orientation icons
Yes, with transforms. I still need to figure out how to use more than one CSS property for one typography setting in the style engine. |
Related to this comment, and also as noted here, can we leverage the text-align buttons for this flipping? Essentially when you choose "text align right" in that case, it'd transform/flip the text. |
I like that! |
@carolinan I'm trying to test this change and can't find the orientation control in the typography panel for Paragraph blocks. Am I missing something? Does this have to be enabled in the theme? |
Yes, this setting is disabled by default and can be enabled for themes that include theme.json. It is in the testing instructions. |
Oooh I missed that somehow, thanks! |
What?
Adds a new text orientation option where text can be displayed horizontally or vertically.
Partial for #50319
Why?
To allow more design options.
How?
writing-mode
through the Style Engine.Testing Instructions
This setting is disabled by default and can be enabled for themes that include theme.json.
writingMode: true
Testing Instructions for Keyboard
Screenshots or screencast
orientation.mp4