Skip to content

Conversation

@johngodley
Copy link
Member

This moves all the CSS from front.css into style.css. The block then operates as a normal block without any additional loading of CSS files.

The reason a front.css was created is to better seperate the grid styles in the editor from the ones on the front. These are necessarily different (the editor has a very different DOM to the rendered block), but were causing clashes.

To work around this I've tied all the editor grid CSS to wp-block-jetpack-layout-grid-editor instead of wp-block-jetpack-layout-grid.

This should mean it will now work with block-based themes.

Fixes #170

Change all `wp-block-jetpack-layout-grid` references to `wp-block-jetpack-layout-grid-editor`. This way we can separate it from the front end CSS, which is simpler.
This simplifies the loading to standard block CSS
The removal of hyphenation means these need updating
@johngodley
Copy link
Member Author

@jasmussen can you see any problems with this approach?

The PR might seem quite chunky, but it's mostly updating visual unit test snapshots, and removing code.

It'll certainly need some good testing with actual examples, but the visual tests show no difference on the front end, and I can't see any differences in the editor.

@jasmussen
Copy link
Member

No, I think this makes a lot of sense. And in a quick test of this PR it seemed to work well.

What kind of testing do we have available other than to ping friendly folks to ask for their help? It looks and seems solid, but it sounds like a big shift. Maybe it isn't?

@johngodley
Copy link
Member Author

I think it looks worse than it is. If problems are going to surface it will be in the editor, not the front end, so it should be fairly safe in terms of not breaking a site.

@jasmussen
Copy link
Member

Let's do it.

@mkaz
Copy link
Contributor

mkaz commented Mar 23, 2021

Confirmed this fixed the issue with a block-based theme and layout grid not working on front-end. 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Layout Grid: Doesn't work with block based themes

4 participants