You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm currently working on a headless WordPress project where the backend is powered by WordPress and the frontend is built using Next.js. One of the main challenges I'm facing is ensuring that the styles configured in the Gutenberg editor (e.g., font sizes, colors, and other block-specific styles) are reflected accurately on the frontend.
Challenges:
Gutenberg generates numerous utility classes like is-content-justification-center and wp-block-buttons-is-layout-flex. Replicating these manually is cumbersome and error-prone.
Inline styles and block-level attributes (e.g., typography, colors) are not easily accessible unless parsed and re-applied programmatically.
The theme.json file provides a great foundation for global styles, but translating its configuration into a frontend-compatible format requires additional work.
Questions for the Community:
Is there an existing method or tool for exposing all block styles (both default and custom) for headless frontends?
Has anyone successfully used the theme.json file to dynamically generate frontend styles?
Are there recommended approaches or best practices to achieve consistent styling between Gutenberg and a decoupled frontend?
My ultimate goal is to allow non-technical users to make visual style changes in the WordPress editor (like font size or colors) and have those changes reflected on the frontend without manual intervention.
I’d love to hear about any solutions, ideas, or workflows you’ve implemented for similar setups. Looking forward to learning from your experience and expertise!
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hi Gutenberg Community,
I'm currently working on a headless WordPress project where the backend is powered by WordPress and the frontend is built using Next.js. One of the main challenges I'm facing is ensuring that the styles configured in the Gutenberg editor (e.g., font sizes, colors, and other block-specific styles) are reflected accurately on the frontend.
Challenges:
Gutenberg generates numerous utility classes like is-content-justification-center and wp-block-buttons-is-layout-flex. Replicating these manually is cumbersome and error-prone.
Inline styles and block-level attributes (e.g., typography, colors) are not easily accessible unless parsed and re-applied programmatically.
The theme.json file provides a great foundation for global styles, but translating its configuration into a frontend-compatible format requires additional work.
Questions for the Community:
Is there an existing method or tool for exposing all block styles (both default and custom) for headless frontends?
Has anyone successfully used the theme.json file to dynamically generate frontend styles?
Are there recommended approaches or best practices to achieve consistent styling between Gutenberg and a decoupled frontend?
What I’ve Tried So Far:
Goal:
My ultimate goal is to allow non-technical users to make visual style changes in the WordPress editor (like font size or colors) and have those changes reflected on the frontend without manual intervention.
I’d love to hear about any solutions, ideas, or workflows you’ve implemented for similar setups. Looking forward to learning from your experience and expertise!
Thank you!
Best regards,
Feroz
Beta Was this translation helpful? Give feedback.
All reactions