Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upBlock Support: Add font style and weight options with combined UI #26444
Conversation
@jasmussen Hope you don't mind I started a fresh PR for this. When you get the chance can you take a look at the new control combining font style and weight options? I'm not sure if it needs separators between the groups of weight/style combos. Also, should it be 100% width or do you see it potentially fitting in alongside other options? |
Nice. This is what I see: The names are all-caps, due to this rule it appears: It seems that rule was intended for menu subheadings, but is a little wide-reaching. Suffice to say, the fonts should not be all-caps, and should be the usual Other than that, this is working well, and feels obvious. |
I've updated the control's styling so the items:
Thanks for all the feedback. I think this is getting close now |
Adds both font style and font weight block support options. The UI for both are combined into a single dropdown. The inline styles generated via this feature leverage CSS variables.
ca28824
to
66805f0
I've rebased this to pull in the latest changes in approach to registering/applying block support. I think this just needs a review now to move forward. |
This is cool: I think you should sync up with @karmatosed per the opportunity outlined in #26572 (comment), it looks like you're both touching the same files, and the color, font size, all caps styles that are currently inherited, probably shouldn't be inherited at all. |
I'm glad you're happy so far with the combined weight/style dropdown.
Agreed. Those styles appear to be applied when they shouldn't be. I was hoping to be able to take a look at where they are actually used and tweak the CSS accordingly. I will probably do that via a separate PR though. |
By the way, can you add a separator between the regular and italic weights? It's not super necessary but would be nice. |
I initially thought it could do with a separator in there as well although I didn't find an obvious option to do that. Now, it's been brought up, I'll take another look at it next week. My main issue was making sure that I wasn't adding another option that users could interact with or would impede accessibility. If anyone has any suggestions for doing this with a |
The separator should not block this PR. |
Description
After feedback and discussion around adding block support for font styles ( #26050 ), it was decided to add support for both font styles and font weights, then combine the UI controls for them.
Changes Included
How has this been tested?
Manually tested using navigation block.
Test Instructions
var()
and CSS variables relating to the selection made.Screenshots
Types of changes
Enhancement
Next Steps
class-block-supported-styles-test.php
if needed after approach confirmed.Checklist: