What problem does this address?
Use case: I am designing a client site where 99% of the text needs to be centered. The default for the CONTENT block is left-align. The default for PARAGRAPH block is left-align.
There is no way inside the Site Editor to set all paragraphs to have textAlign center by default. There is no way inside the Site Editor to set CONTENT block to textAlign to override whatever is inside it.
Why? I don't want the client to have to set textAlign center on every POST inside the content itself (ie: each individual paragraph). I want the CONTENT BLOCK in the various page templates to be able to control textAlign of its child blocks.
Perhaps it's a specificity thing, but presumably as long as the client doesn't override with block-level settings, the earlier CSS in the cascade should work.
I want to avoid using CSS to do this and want to do it all inside the Site Editor. The only way I got it to work was to write CSS manually.
What is your proposed solution?
A quick search suggests this is possible but only with code in theme.json:
{
"version": 2,
"settings": {
"blocks": {
"core/paragraph": {
"typography": {
"textAlign": true
},
"attributes": {
"textAlign": {
"default": "center"
}
}
}
}
}
}
AND THEN ALSO INSIDE STYLES:
"core/paragraph": {
"typography": {
"textAlign": "center"
}
},
ISSUE WITH THIS APPROACH: However, this option for some reason even overrides block-level controls. I have some other PARAGRAPH blocks set to left-align manually within a page, and it does not honor this user-selected block-level setting. There is some kind of specificity war happening and generally user-overrides are supposed to win over theme.json and other global styles, no?
BETTER OPTION:
It would be great if this was surfaced in the Style Book/Styles UI of the Site Editor. (hopefully the goal is for every possible theme.json option to be in the UI at some point?!)
The current default to textAlign: left assumes everyone on the web is using left-aligned for all their content. This may be true, but it would be great to have this be something anyone can set in the UI.
Am I totally missing something?
What problem does this address?
Use case: I am designing a client site where 99% of the text needs to be centered. The default for the CONTENT block is left-align. The default for PARAGRAPH block is left-align.
There is no way inside the Site Editor to set all paragraphs to have textAlign center by default. There is no way inside the Site Editor to set CONTENT block to textAlign to override whatever is inside it.
Why? I don't want the client to have to set textAlign center on every POST inside the content itself (ie: each individual paragraph). I want the CONTENT BLOCK in the various page templates to be able to control textAlign of its child blocks.
Perhaps it's a specificity thing, but presumably as long as the client doesn't override with block-level settings, the earlier CSS in the cascade should work.
I want to avoid using CSS to do this and want to do it all inside the Site Editor. The only way I got it to work was to write CSS manually.
What is your proposed solution?
A quick search suggests this is possible but only with code in theme.json:
ISSUE WITH THIS APPROACH: However, this option for some reason even overrides block-level controls. I have some other PARAGRAPH blocks set to left-align manually within a page, and it does not honor this user-selected block-level setting. There is some kind of specificity war happening and generally user-overrides are supposed to win over theme.json and other global styles, no?
BETTER OPTION:
It would be great if this was surfaced in the Style Book/Styles UI of the Site Editor. (hopefully the goal is for every possible theme.json option to be in the UI at some point?!)
The current default to textAlign: left assumes everyone on the web is using left-aligned for all their content. This may be true, but it would be great to have this be something anyone can set in the UI.
Am I totally missing something?