-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Duotone: Dynamic filters based on theme.json variables #33905
Comments
I was very surprised when I learnt that this did not already work, how can we assure that this is included in the MVP's of any new color features? |
I have received another support question about why presets do not work with the duotones. |
Ran into this over the weekend. We really need a solution for this. Duotone could be so powerful if it accepted variables. |
Hey guys, really hoping for this to be solved one day. I'm creating a FSE theme that adds a lot of patterns using duotone. It also has global styles, but the changes won't be reflected if the duotone configuration does not accept css variables 😢 |
Has anyone had improvements on this? I was hoping that the new |
The new If {
"settings": {
"color": {
"duotone": [
{
"colors": [
{ "ref": "settings.color.palette[0].color" },
{ "ref": "settings.color.palette[1].color" }
],
"name": "Base and primary",
"slug": "base-and-primary"
}
],
"palette": [
{
"color": "#1E1E1E",
"name": "Base",
"slug": "base"
},
{
"color": "#3858E9",
"name": "Primary",
"slug": "primary"
}
]
}
}
"styles": {
"blocks": {
"core/image": {
"filter": {
"duotone": "var(--wp--preset--duotone--base-and-primary)"
}
}
}
}
} I think using |
Is there any progress on this issue? What needs to be done to move it forward? |
What problem does this address?
The use case for this feature would be a theme that wants to apply a duotone filter based on the colors of the theme. In this example we can think about the background/text color combo such as here:
It would be great if we could define the preset filter in this way in theme.json:
So that when the user changes the background color of their site, the already existing images will mage the new background color too.
The text was updated successfully, but these errors were encountered: