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

Better Gutenberg Block's style system #44

Open
drewbaker opened this issue Apr 4, 2022 · 7 comments
Open

Better Gutenberg Block's style system #44

drewbaker opened this issue Apr 4, 2022 · 7 comments
Labels
nuxt 2 Issues relating to the Nuxt 2 version of fuxt

Comments

@drewbaker
Copy link
Member

The WordPress editor now is a “block” editor, and includes lots of flexibility (they call it Gutenberg). On the frontend, we’ve built a lot of Vue components that work with the backend “blocks”. But the CSS is very complicated and I’m not sure it is as good as it could be. I’d really like to figure out a better way to architect these “blocks” and have them still be flexible for the frontend. I think this is mostly a CSS problem as the Vue components are pretty basic and I’ve built them already (maybe some slight changes to HTML would help).
https://github.com/funkhaus/fuxt/tree/master/components/gutenberg
https://github.com/funkhaus/fuxt/blob/master/components/WpGutenberg.vue

The key is these blocks need to be generic and flexible mostly, as we use them on all our sites. Ideally we just tweak some fonts and colors on every new site, maybe change some props or perhaps CSS variables to tweak margins etc.

These “blocks" are what build out a page like this:
https://mssngpeces.com/projects/commercials/pinterest-calling-all-creators/

So, I’d really like someone to architect out a better CSS approach to all these blocks that interact with each other (it can get complex, with blocks nested inside a column-block).

The final level is making the frontend CSS match the WordPress editor approximately. How to do that is explained here:
https://developer.wordpress.org/block-editor/how-to-guides/themes/theme-json/

We'd also want to merge in all our custom blocks that we build, and have those work with the CSS system we develop. So far the sites for Tool and MssngPeces have custom blocks for theme. We'd need to include the PHP templates for them in fuxt-backend, and include a blocks.json file of the ACF export's in fuxt backend too.

@drewbaker
Copy link
Member Author

Perhaps we can use this on the front end somehow?
https://fuxt-backend.funkhaus.us/wp-includes/css/dist/block-library/style.min.css

@drewbaker
Copy link
Member Author

@drewbaker
Copy link
Member Author

@drewbaker
Copy link
Member Author

Lesson learned...

Use consistent prop names across all components. For example innerBlocks is best for all inner blocks.

@drewbaker
Copy link
Member Author

If we decided to not use Blocks for gutenberg, and just work with the rendered HTML, this would help https://github.com/natemoo-re/ultrahtml

@drewbaker
Copy link
Member Author

@drewbaker
Copy link
Member Author

@drewbaker drewbaker added the nuxt 2 Issues relating to the Nuxt 2 version of fuxt label Sep 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
nuxt 2 Issues relating to the Nuxt 2 version of fuxt
Projects
None yet
Development

No branches or pull requests

1 participant