-
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 a way to rotate text #20926
Comments
Hell yes. Serendipitously, the G2 efforts have "detached" the toolbar from the block itself, which means we could theoretically rotate the block contents with For the beautiful block pattern shown here, it seems like it might be possible to accomplish this with a 2 column block, with 2 paragraphs in the left column, and an image in the right. POSSIBLY. I did have a past exploration for rotating text: But I'm not too hot on that one anymore. I'm not sure it should be an on-block tool like that — my current instinct would be to first test a button in the toolbar or block sidebar that simply rotates a block 90 degrees. I expect the UI/layout challenges even with those preset angles to be worth tackling first. Then if that goes well, we could unlock all the degrees. |
A simple step, rather than free form rotating, could be to consider a setting on column containers (maybe also groups) to lay out the content vertically and it would apply to all the child blocks within. Editing could also be tricky to make truly usable. |
As I was thinking of a reply the idea of the toolbar changing when you are interacting with text feels right for these type of advanced options. I am not sure if you'd have to highlight text to get this to happen but it feels right when selected. I do also like idea it could be on the block. It might be part of the block adjustments like width and alignment. |
Just my 2 cents here, but niche cases like rotating text is not something one does often, and therefore should not be included in core. It's an edge-case, not the norm. |
Do folks think this feature is still valid? If so, I'm thinking it could possibly be another optional control under Typography supports panel (?) |
Free-form rotating of text might be exotic, and could be interesting mostly if it feels super right in a PR. However vertical text feels (as a suggested simpler step) feels both valid, but also important to many east asian languages that in traditional contexts are written vertically. In that light, I think it could be nicely supported as a non-default typography option that used the web-standards created to support such languages:
|
+1 for vertical text it feels valid and in-fact I have found myself 'faking' it very poorly to get around with bad hacks. |
Maybe it makes sense to try a writing-mode typography control out on a "containing" block first? Here's some Japanese in a group block: And the CSS. writing-mode: vertical-rl; // variable via controls vertical-rl/vertical-lr/horizontal-tb (default)
text-orientation: upright; // variable via controls mixed (default)/upright
margin-top: 0 !important; // overwrites --wp--style--block-gap
margin-left: auto !important;
margin-right: auto !important; Reference: https://www.w3.org/International/articles/vertical-text/ What do folks think about controls in the Block Inspector? Would something like (and presumably better than) this make sense? I see Figma uses a combination of arrows and text-alignment icons: |
Yes, yes and yes 😄 Thanks for the quick response and great ideas @jasmussen The idea of starting off with a toggle/arrows (and taking it from there) appeals to me extraordinarily. 🙇 Also cc @naokomc - what's your take on the desire for vertical writing modes in Japanese? |
If all of the text is in Japanese characters then In a perfect world, having control over changing orientation for part of the text would be nice (e.g. numbers or single letter Latin text usually should be treated differently to look the best). Example: https://codepen.io/manabox/pen/vJjxpX (from @manabox - she also has workaround examples for link underline position, which should be on the right-hand side for Japanese https://codepen.io/manabox/pen/MvXbWx) Related: https://www.shopify.com/partners/blog/html-localization |
This is great, thanks for the advice @naokomc ! |
Hi, I also tried to create a sample of vertical Japanese writing with CodePen. https://codepen.io/miminari-the-scripter/pen/RwLqmvY Wouldn't it be great if WordPress could do vertical writing! |
I'm experimenting with adding vertical text layout support over at #37932 I started off categorizing vertical text direction as a "layout" issue as opposed to a "typography", primarily because it requires a few layout changes, but also because fiddling with writing modes changes the block flow direction. The possible consequence is that we'll need to tweak existing properties that apply to horizontal elements. For example we apply Anyway, while I'm not sure if my approach has legs, I hope to learn a few things and keep the fire burning. Arigato gozaimasu! |
I've had a PR rolling for a while that will add Out of the box it'll apply to the entire container: Which isn't exactly fetching. If we're to target individual cells, then something at the toolbar level might be more suitable. Just thinking out loud, it might be possible after this PR lands (skipping individual block supports) to rewire the table block and apply the style to specific cells. There are issues suggesting a major overhaul/enhancement of the table block. |
If the table block were to support inner-blocks, then it would presumably get the per-paragraph rotation from your PR for free? If yes, that seems like a good argument for some of those larger Table block enhancements to land first. |
I don't think the table block would ever support arbitrary inner blocks, fwiw. |
Oh of course, a paragraph inside a cell would mean still more inner blocks. But it would be nice if the same orientation property could be opted in by the cell itself then. |
Free-form rotating text can potentially be useful. It can even work together with vertical text through the |
I'm going to close this as done given the OP request is for vertical text rather than free form rotation which seems a separate matter. |
I think we need to allow horizontal flipping here to cover the design use cases. |
It might not be an everyday thing, and there might be some interesting challenges, but it'd be great if we have a way to rotate a text to allow creating little interesting patterns.
Example:
cc @jasmussen for the past explorations around rotating text.
The text was updated successfully, but these errors were encountered: