-
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
Enable justifying text #60488
Enable justifying text #60488
Conversation
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 If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.
To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
Warning: Type of PR label mismatch To merge this PR, it requires exactly 1 label indicating the type of PR. Other labels are optional and not being checked here.
Read more about Type labels in Gutenberg. Don't worry if you don't have the required permissions to add labels; the PR reviewer should be able to help with the task. |
👋 Thanks for your first Pull Request and for helping build the future of Gutenberg and WordPress, @normana10! In case you missed it, we'd love to have you join us in our Slack community. If you want to learn more about WordPress development in general, check out the Core Handbook full of helpful information. |
Controls for justifying text has a long history in WordPress, where they have been added and removed multiple times. There is an ongoing effort to add a text alignment block support, including justified text. Because of that I am not sure how to move forward with this pull request. |
Thanks for the ping! The latest status regarding text alignment in Gutenberg is as follows:
What is consistent throughout these issues/PRs is that the @carolinan Do you know core tickets discussed regarding controls for justifying text? I couldn't find it 😅 |
(Sorry for the delay) Thanks @t-hamano for all the context Not sure I understand the hesitance of block-level justify, but I respect the decision I'll close this PR out In the meantime, does anyone know if there is an issue I can watch to follow progress on this set of mockups: #59531 (comment) As I suppose that'd serve my use-case And/or is there a JS hook I can reach into to to add justify at the block-level on my site? (I'm still somewhat new to the JS-hook side of things) Thanks! |
Hi @normana10, Thanks for the replay.
We plan to add text alignment UI to the global style UI at the following two levels.
Via the Formatting Toolbar API, you will be able to freely add controls to the block toolbar. By the way, WordPress.com sites already have their own Justify option implemented in the block toolbar, so you might find that code helpful as well. |
In case anyone ever gets here from a Google search I ultimately just put:
In "Additional CSS" So all text is justified by default and you can easily override it with the normal text-alignment control Thanks all! |
https://make.wordpress.org/core/2016/10/28/editor-changes-in-4-7/ |
What?
Add the "Justify text" option to alignment controls
Why?
I wanted to justify text on some of my pages and was able to get it implemented, so I thought I would share (I even went and made my own SVG until I realized that the
align-justify
icon already exists 🤦♂️)How?
Adds an option to
DEFAULT_ALIGNMENT_CONTROLS
as well as the corresponding CSS class (I was trying to follow.has-text-align-left
around as it seems to have a bunch of references near blockquotes and vertical writing modes and I wasn't sure if.has-text-align-justify
should be put there as well, feel free to let me know and I'll add them)Testing Instructions
Testing Instructions for Keyboard
"Justify text" is navigable to via the arrow keys and selectable using space like the other alignment controls
Screenshots or screencast
Thanks!