-
Notifications
You must be signed in to change notification settings - Fork 1
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
Add default spacing styles #1
Comments
Something to consider. Should we set |
Should spacing be reduce for smaller viewports? Especially |
FSE themes are able to declare custom spacing in theme.json. In that linked example, Twenty Twenty-Two provides small, medium, large, and outer, which generates variables like Rich Tabor proposed a custom baseline style, which would have been interesting. It does seem that themes, even his , have started to adopt the Twenty Twenty-Two approach. It does not seem like many (I looked at 6) are setting their own variables apart from the custom variables generated by WP. So, my guess...
I think that looks something like this:
Other notes:
|
It seems like there may be an opportunity to start assuming that WordPress uses those spacing options to set variables for TT3 includes 30,40,50,60,70,80, though unfortunately names them as 1,2,3,4,5,6. Still - I think we can adapt the default naming structure provided by WordPress:
We can then loop through the available sizes with So, this:
Becomes a list of options for X-Small, Small, and Medium, while:
becomes a list of Little, Less Little, and Huge. I also think we should consider changing the class name to
|
Potential default styles for the plugin. The 2021 theme for WordPress uses the variable
--global--spacing-unit
to set a default spacing to apply to margins and paddings. If a theme has--global--spacing-unit
set then that will be used by the plugin. If not, then a fallback of1.25rem
(20px on most browsers, unless changed by the themes CSS) will be used as the base for plugin. Each option will use a multiple of the set spacing.The text was updated successfully, but these errors were encountered: