Skip to content

Make duotone colors dynamic on theme.json #73280

@henriqueiamarino

Description

@henriqueiamarino

Today
Currently, duotone definitions in theme.json cannot reference CSS variables such as var(--wp--preset--color--primary). Duotones only accept hard-coded color values, which prevents themes from using global presets or adapting to changes introduced by style variations.

Example of the current limitation:

			"defaultDuotone": false,
			"duotone": [
				{
					"colors": [
						"#FAFAFA",
						"#030201"
					],
					"name": "Default",
					"slug": "duotone-default"
				},

This means that a duotone filter must always remain static, even when theme colors are updated elsewhere.

Desired Future
It should be possible for duotone filters to use CSS custom properties—especially preset colors defined in theme.json. This would allow duotones to automatically adapt to each style variation and remain consistent with the theme’s color system.

Proposed example:

			"defaultDuotone": false,
			"duotone": [
				{
					"colors": [
						"var(--wp--preset--color--primary)",
						"var(--wp--preset--color--base)"
					],
					"name": "Default",
					"slug": "duotone-default"
				},

Why this matters
• Enables dynamic duotone behavior across style variations
• Keeps filters visually aligned with theme palettes
• Reduces hard-coded values and increases flexibility
• Matches how other color-based features already work in Global Styles

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions