Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set default alignments in theme.json #44007

Open
carolinan opened this issue Sep 9, 2022 · 3 comments
Open

Set default alignments in theme.json #44007

carolinan opened this issue Sep 9, 2022 · 3 comments
Labels
[Feature] Theme Style Variations Related to style variations provided by block themes [Type] Enhancement A suggestion for improvement.

Comments

@carolinan
Copy link
Contributor

carolinan commented Sep 9, 2022

What problem does this address?

In block themes, when alignments are set in the block markup itself, there is no way to change this alignment using style variations.

Example:

<!-- wp:heading {"textAlign":"center","align":"wide","style":{"spacing":{"margin":{"top":"var:preset|spacing|60","bottom":"var:preset|spacing|50"}}}} -->
<h2 class="alignwide has-text-align-center" style="margin-top:var(--wp--preset--spacing--60);margin-bottom:var(--wp--preset--spacing--50)">Mindblown: a blog about philosophy.</h2>
<!-- /wp:heading -->

Because "textAlign":"center" and has-text-align-center is in the markup, it can not be changed by adding a style variation.
If the textAlign: "center" was in theme.json, then blue.json could set it to textAlign: "none" or similar.

What is your proposed solution?

Allow setting default alignments for blocks using theme.json. Then alignments that are consistent with the default, can be removed from the HTML files in block themes.

@carolinan carolinan added the [Type] Enhancement A suggestion for improvement. label Sep 9, 2022
@mtias
Copy link
Member

mtias commented Sep 10, 2022

Duplicate of #30761 ?

@carolinan
Copy link
Contributor Author

I meant left/right/center alignments.
For example, setting the post title to be centered by default. This was proposed by @critterverse for the style variations in TT3, but it is not possible today.

@rexwreyes
Copy link

Yes, this was a seriously stupid decision. I spend more time now trying to figure out how to hack Wordpress because they keep locking you out of setting up different alignments for different screen sizes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Theme Style Variations Related to style variations provided by block themes [Type] Enhancement A suggestion for improvement.
Projects
None yet
Development

No branches or pull requests

4 participants