WordPress / gutenberg

The Block Editor project for WordPress and beyond. Plugin is available from the official repository.
https://wordpress.org/gutenberg/
Other
10.34k stars 4.13k forks source link

Add strong and other bold-by-default elements to the theme.json elements block #57583

Open RatzeR opened 8 months ago

RatzeR commented 8 months ago

What problem does this address?

I attempted to alter the font weight of all my strong-tags without resorting to custom CSS. So, I took the most straightforward approach and attempted to do this within my theme.json in the styles section...

styles.elements.strong

... only to discover that this is currently not supported.

The font weight of the strong-tag is presently set by the browser's agent styles to bold (700). Since this is relatively heavy, it can pose issues for designs that primarily employ lighter fonts. These designs might require a font weight of 500 on the strong-tags to maintain an optimal appearance.

For reproduction / testing the default styles of the strong tag the Twenty Twenty-Four Theme can be used.

What is your proposed solution?

Also make other tags that are bold by default customizable:

carolinan commented 2 months ago

Related: https://github.com/WordPress/gutenberg/issues/54680

It is strange to me that if you use the toolbar option, B to make parts of your text "Bold" it is actually strong, not b, that is inserted. Since the editor lets users use strong this way, I agree the styling should be possible.