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
Find a better approach for centering blocks by default #30
Comments
.entry-content > * {
margin: 1.5em auto;
max-width: 740px;
padding-left: 20px;
padding-right: 20px;
} |
|
Does that work across all device though? Also what about where there are classes on entry-content? Would be great maybe to get a PR. |
Anyone up for making a PR trying it out? |
|
@jasmussen may have solved this in a similar way so throwing in for a suggestion:
|
PR: #35 Here's a before (master branch) of the Gutenberg demo content page: With PR: Notes:
|
I think to work across all instances article is better maybe @amdrew - is there a reason you didn't use the version suggested? I think the :not does have a value where overriding isn't needed, but I'd want to be sure. |
Yes, the CodePen (https://codepen.io/joen/full/oEzYxb/) assumes that all blocks are a direct child of That works great, but in this theme, the We need to target the direct children of whichever element houses all the blocks. In the theme, this is the div with the class of This shows all the blocks are direct children of We could still use the suggested code with .entry-content > *:not( .alignwide ):not( .alignfull ) {
// code here
} We'd then need to fix the image in the demo being full-width, since it has the |
Circling back to the initial comment on this issue (#30 (comment)):
It be great if there actually was a shared class that existed. Thinking outside the bounds of this theme, we can never guarantee that a theme even has an Something like Anyone agree/disagree? An issue for the Gutenberg repo perhaps? |
Right now, this won't be possible because some blocks like the "classic block" don't have wrappers. |
Just a small clarification. The |
Closing as merged. |
I agree that the class |
So we don't have to manually center every block by hand. Is there a shared class we can call on?
The text was updated successfully, but these errors were encountered: