Skip to content

Make duotone colors dynamic on theme.json #73280

Closed as duplicate
Closed as duplicate

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

Activity

  1. added
    [Type] Enhancement
    on Nov 14, 2025
  2. yankiara commented on Dec 21, 2025

    @yankiara

    I highly support this, thanks for opening!
    Also, sorry if obvious, but support for oklch or any other CSS color function is essential.

  3. hanneslsm commented on Jan 6, 2026

    @hanneslsm

    I'm closing this issue as a duplicate of #33905

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    [Type] Enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions