Repository navigation
Add experimental font size attribute to Navigation block - #24531
Conversation
| { | ||
| backgroundColor: true, | ||
| textColor: true, | ||
| fontSize: fontSize.size, |
There was a problem hiding this comment.
With this new setup, how can we pass the font size value to the color panel contrast checker? I noticed that ColorEdit and ColorPanel components don't explicitly deal with font size, and it's not being passed to the contrast checker in e.g. the Paragraph and the Heading block color panels.
There was a problem hiding this comment.
Hi @tellthemachines, good point. It seems currently for paragraph and heading we are not passing fontSize related information so the checker always assumes the font size is small. I verified gutenberg/packages/block-editor/src/hooks/color-panel.js is retrieving the colors from the dom, I guess it can easily be enhanced to also retrieve the font size in a separate PR.
There was a problem hiding this comment.
Cool, is this mentioned in any existing issue or shall I create a new one?
There was a problem hiding this comment.
I am not aware of an issue for it so I guess we should create a new one.
|
Size Change: +181 B (0%) Total Size: 1.16 MB
ℹ️ View Unchanged
|
| { | ||
| backgroundColor: true, | ||
| textColor: true, | ||
| fontSize: fontSize.size, |
There was a problem hiding this comment.
Hi @tellthemachines, good point. It seems currently for paragraph and heading we are not passing fontSize related information so the checker always assumes the font size is small. I verified gutenberg/packages/block-editor/src/hooks/color-panel.js is retrieving the colors from the dom, I guess it can easily be enhanced to also retrieve the font size in a separate PR.
| @@ -50,13 +50,11 @@ | |||
| "showSubmenuIcon": "showSubmenuIcon" | |||
| }, | |||
| "supports": { | |||
There was a problem hiding this comment.
Should we remove the fontSize attribute from block.json as we did for paragraph?
Description
Replaces the current font size sidebar control with the new font size attribute on the Navigation block.
How has this been tested?
Tested in browser.
Screenshots
Types of changes
New feature (non-breaking change which adds functionality)
Checklist: