Open madhusudhand opened 2 years ago
I'm not convinced that we should modify the block styles model, for example, something like this:
"styles": {
"blocks": {
"core/paragraph": {
"typography": {
"fontSize": {
"min": "1em",
"max": "10em",
}
}
}
}
}
If fluid typography is toggled off then the values aren't very useful, or there'd have to be some bespoke code to use fontSize.min
instead.
Maybe a new property under typography
would be better: fluidFontSize
or something.
Another possibility would be have a flag in the settings.typography.fontSizes
items that would indicate whether it should appear in the UI control as an option or not. That way the preset would be generated but it wouldn't appear in the list.
Another possibility would be have a flag in the settings.typography.fontSizes items that would indicate whether it should appear in the UI control as an option or not. That way the preset would be generated but it wouldn't appear in the list.
I like this idea of being able to define the sizes that are required for a theme, all in a single place and expose only the standard sizes to appear in UI control. The flag could be anything like hidden
which is false
by default, and set it to true
in the additional sizes that need not appear in UI.
"fontSizes": [{
"size": "2rem",
"fluid": {
"min": "2rem",
"max": "2.5rem"
},
"slug": "huge",
"name": "Huge",
"hidden": true
}]
What problem does this address?
This is an extension of #24480
In the scenarios where the blocks of the theme needs fluid typography, defining them under
settings
and using them as variable under a block, would overload thefont size
dropdown in the editor UI.In multiple cases the defined typography is meant only for specific blocks such as
post-title
that doesn't have a size configuration, and showing all of them in the editor UI is unnecessary.What is your proposed solution?
Enable fluid typography at block level to avoid many unrelated definitions being defined in settings.