-
-
Notifications
You must be signed in to change notification settings - Fork 41
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
[request] useTailwindSpacing() #2184
Comments
I've never configured spacing settings in either tailwind or the wp theme manifest. Is there a relationship between If so, could you provide the tailwind config that would generate the output you already provided? |
Spacing Scale would have to be inferred unfortunately because tailwind doesn't have a functionality like that (not surprising because tailwind doesn't use sliders). However, spacingSizes could work like so I believe: module.exports = {
theme: {
spacing: {
'0': '0px',
'px': '1px',
'0.5': '0.125rem',
'1': '0.25rem',
'1.5': '0.375rem',
'2': '0.5rem',
...theRestOfThem
}
}
} Perhaps the inference of spacingScale could be created from that? |
I think it is probably best to not try and infer and leave it up to the developer to define using the bud.wpjson
.set(`settings.spacing.spacingScale.operator`, `+`)
.set(
'settings.spacing.spacingScale.steps',
Object.keys(bud.tailwind.theme.spacing).length
) But I'm still down for adding a simple function to generate the |
It's actually chaos that WordPress lets you both define a scale and define the size entries themselves, when you think about it 😅 |
You're right it's a weird system lol. I'm not sure if your spacingscale will work, but I'll try it. |
For [@roots/bud-tailwindcss](https://bud.js.org/extensions/bud-tailwindcss)+[@roots/bud-wordpress-preset](https://bud.js.org/extensions/bud-wordpress-preset) users: Add support for `theme.spacing` and `theme.extend.spacing` to theme.json generator. ## Example ```ts bud.wpjson .useTailwindColors() .useTailwindFontFamily() .useTailwindFontSize() .useTailwindSpacing() ``` ## Reference - Feature proposed in #2184 ## Type of change **PATCH: backwards compatible change**
Agreement
The feature
useTailwindSpacing()
Request for another method to keep spacing consistent with Tailwind design methodologies when using Tailwind with bud.
Theme.json Spacing JSON Generated:
Use case
This feature will be useful for anyone who wants greater parity between Tailwind & Gutenberg styles
Notes
No response
The text was updated successfully, but these errors were encountered: