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

Site Tagline: Support margins in theme.json #35323

Closed
scruffian opened this issue Oct 4, 2021 · 4 comments
Closed

Site Tagline: Support margins in theme.json #35323

scruffian opened this issue Oct 4, 2021 · 4 comments
Labels
[Block] Site Tagline Affects the Site Tagline Block

Comments

@scruffian
Copy link
Contributor

What problem does this address?

The site tagline block uses a paragraph element, which means it inherits the margins from CSS for paragraphs:
Screenshot 2021-10-04 at 13 49 30

What is your proposed solution?

If we could control the margins in the theme.json, we could override these margins without CSS.

@scruffian scruffian added the [Block] Site Tagline Affects the Site Tagline Block label Oct 4, 2021
@carolinan
Copy link
Contributor

carolinan commented Oct 4, 2021

I was able to reproduce this, but it is only the left and right margins that are overwritten, not top and bottom.
In the editor, this style is overwriting the tag line styles:

.editor-styles-wrapper .edit-post-visual-editor__post-title-wrapper > *,
.editor-styles-wrapper .block-editor-block-list__layout.is-root-container > * {
    max-width: 840px;
    margin-left: auto !important;
    margin-right: auto !important;
}

My theme.json style was:

"core/site-tagline": {
				"spacing": {
					"margin": {
						"top": "15px",
						"right": "15px",
						"bottom": "15px",
						"left": "15px"
					}
				}
			}

.editor-styles-wrapper .wp-block-site-tagline {
    margin-top: 15px;
    margin-right: 15px;
    margin-bottom: 15px;
    margin-left: 15px;
}

@carolinan
Copy link
Contributor

Perhaps you could use padding as a work around for now?

@scruffian
Copy link
Contributor Author

The issue in this case is that the block is inheriting margins from the theme's paragraph CSS, not from Gutenberg's. I could modify my theme CSS to include a :not(.wp-block-site-tagline) but I think it would be useful for themers generally to be able to control these margins.

@ndiego
Copy link
Member

ndiego commented Jun 12, 2023

The Site Tagline block now supports margin, so this can be closed.

@ndiego ndiego closed this as completed Jun 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Site Tagline Affects the Site Tagline Block
Projects
None yet
Development

No branches or pull requests

3 participants