Custom style button – theme.json
-
Hey TT4
I am trying to style the global button from my TT4 child theme. Chat GPT propose something along those lines, however it takes no effect:
"styles": {
"elements": {
"button": {
"color": "var(--wp--preset--color--draupnir-red)",
"backgroundColor": "var(--wp--preset--color--base)",
"border": "none",
"borderRadius": "16px",
"padding": "10px 15px",
"fontSize": "var(--wp--preset--font-size--medium)",
"cursor": "pointer",
":active": {
"boxShadow": [
{
"offset": { "x": 1, "y": 1 },
"blur": "2px",
"color": "var(--wp--preset--color--draupnir-shadow)",
"inset": true
},
{
"offset": { "x": -1, "y": -1 },
"blur": "2px",
"color": "var(--wp--preset--color--base-2)",
"inset": true
}
]
},
":focus": {
"color": {
"background": "var(--wp--preset--color--contrast-2)",
"text": "var(--wp--preset--color--base)"
},
"outline": {
"color": "var(--wp--preset--color--contrast)",
"offset": "0px"
},
"border": {
"color": "var(--wp--preset--color--contrast-2)"
}
},
":hover": {
"color": {
"background": "var(--wp--preset--color--contrast-2)",
"text": "var(--wp--preset--color--base)"
},
"border": {
"color": "var(--wp--preset--color--contrast-2)"
},
"boxShadow": [
{
"offset": { "x": -2, "y": -2 },
"blur": "5px",
"color": "var(--wp--preset--color--base-2)"
},
{
"offset": { "x": 2, "y": 2 },
"blur": "5px",
"color": "var(--wp--preset--color--draupnir-shadow)"
}
]
},
"spacing": {
"padding": {
"bottom": "0.6rem",
"left": "1rem",
"right": "1rem",
"top": "0.6rem"
}
},
"typography": {
"fontSize": "var(--wp--preset--font-size--small)",
"fontStyle": "normal",
"fontWeight": "500"
}
}
},What did I miss and what is wrong?
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
The topic ‘Custom style button – theme.json’ is closed to new replies.
