Defining Block Styles via theme.json & custom block styles #189
ashleyshaw
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Introduction:
LSX Design doesn’t fully leverage the latest WordPress features introduced in versions 6.5 to 6.7, such as block variations, advanced template management, and typography presets.
As part of our continued effort to integrate the LSX Design system with key WordPress plugins, we’re planning to enhance WooCommerce compatibility. The goal is to transition from CSS-based styling to JSON configurations for seamless integration across WooCommerce product pages, cart, and checkout flows.
Current State
The LSX Design theme currently applies spacing, fonts, and layout primarily through CSS. While this approach provides control, it relies heavily on extensive stylesheets. WordPress 6.6 introduced several improvements to spacing and layout management directly via
theme.json
, allowing fluid design options using responsive units and predefined font pairings.Problem/Opportunity:
Currently, WooCommerce elements in LSX Design rely partially on CSS for styling. This creates inconsistencies in UI across different components. Transitioning to JSON-based styles will ensure a more streamlined, flexible, and future-proof approach, aligning with WordPress’s evolving global style framework.
theme.json
.Proposed Solution:
We plan to update the LSX Design system by replacing CSS styles with JSON configurations, specifically for WooCommerce components such as product listings, cart, checkout forms, and more. This will allow for deeper integration with WordPress’s block system and global style settings, ensuring design consistency and ease of customization.
clamp()
and other responsive techniques available intheme.json
to control font scaling and layout spacing fluidly, as seen in Twenty Twenty-Five’s implementation.theme.json
and leverage newtheme.json
features for cleaner, more efficient designs.theme.json
.theme.json
.theme.json
, improving performance and maintainability.Alternatives Considered:
We considered maintaining the current CSS setup or using third-party WooCommerce templates. However, these options lack the flexibility and future-proofing offered by JSON-based configurations, which integrate more smoothly with the WordPress block system.
Challenges:
Call for Feedback:
Has anyone transitioned from CSS to JSON for theme styles in WooCommerce or other plugins? I’d appreciate any insights on potential pitfalls or best practices for this process.
Next Steps:
The next step will be to develop a prototype of WooCommerce pages using JSON-based configurations. I will share initial mockups and configurations for review before moving forward with full integration.
Beta Was this translation helpful? Give feedback.
All reactions