-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
FSE: Provide a way for Gutenberg to provide alignment styles for the front end. #26633
Comments
+1 to this. Getting layout & alignment styles correct for blocks is still one of the most complicated and underrated issues in themes dealing with blocks. FSE themes shouldn't have to reinvent the wheel every time, we should come up with some basic styles (maybe opt-in) so that theming becomes a bit easier. |
I just want to note that there are two pretty different approaches to
I mostly see people using the first technique. I prefer the second, and I think the linked article makes a good point about it's flexibility in a block-centric future where I'm not 100% sure what the implications of this are for this ticket, other than that it seems that it's only possible to provide one way or the other and so it should probably provide a way to opt-out of styles for people who want to use the other technique. |
I think for the purposes of this issue, the goal would be to just replicate the method used in the editor (which is more or less the second bullet above). From there, if a theme author wanted to re-write that for some reason, they could do so, and the same code would presumably work in both the editor and the front end. |
In relation to these things talked about in the issue... This shows a boxed layout. |
I think this closed by #29335. |
At the moment, the largest boilerplate part of any block-based theme CSS is its alignment styles. Here's an example from Twenty Twenty-One Blocks:
https://github.com/WordPress/theme-experiments/blob/0984b1edf41d4d525c1d241b52423e21fc234e34/twentytwentyone-blocks/style.css#L35-L109
These styles are only present to mirror the default, wide, and full alignments that are present in the editor. In the editor, those styles are provided to themes by default. This should be the case for the front end as well.
The text was updated successfully, but these errors were encountered: