There seems to be provided functions for useTailwindColors()
, useTailwindFontFamily()
, useTailwindFontSize()
, etc. Why not spacing
too?
I’ve been trying to get this worked out in my project, but my js is poor.
So far… this doesn’t work obviously:
export default async (app) => {
app.wpjson.settings((theme) =>
theme
.set("spacing.spacingSizes", [app.tailwind.resolveThemeValue("spacing")])
)
}
It produces:
// theme.json
"spacingSizes": [
{
"xs": "clamp(0.75rem, 0.69rem + 0.27vw, 0.9375rem)",
"sm": "clamp(1rem, 0.92rem + 0.36vw, 1.25rem)",
}
]
How would I go about returning each as its own object like this example?
"spacingSizes": [
{
"name": "xs",
"size": "clamp(0.75rem, 0.69rem + 0.27vw, 0.9375rem)",
"slug": "xs"
},
{
"name": "sm",
"size": "clamp(1rem, 0.92rem + 0.36vw, 1.25rem)",
"slug": "sm"
},
]