Skip to content
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

Color style variations don't resolve CSS custom properties #62245

Open
fabiankaegy opened this issue Jun 3, 2024 · 1 comment
Open

Color style variations don't resolve CSS custom properties #62245

fabiankaegy opened this issue Jun 3, 2024 · 1 comment
Labels
Backport to WP 6.6 Beta/RC Pull request that needs to be backported to the WordPress major release that's currently in beta Global Styles Anything related to the broader Global Styles efforts, including Styles Engine and theme.json [Type] Bug An existing feature does not function as intended

Comments

@fabiankaegy
Copy link
Member

When defining a color palette in theme.json it is possible to reference external colors by using CSS custom properties as follows:

{
    "settings": {
        "custom": {
            "color": {
                "foo": "#39ab00"
            }
        },
        "color": {
            "palette": [
                {
                    "slug": "foo",
                    "name": "Foo",
                    "color": "var(--wp--custom--color--foo)"
                }
            ]
        }
    }
}

Doing this will resolve the colors correctly everywhere in the UI. However, this is not the case in the new design of style variations, which showcases the different color palettes defined in block theme style variations. There, they appear in greyscale.

CleanShot 2024-06-03 at 17 34 53@2x

@fabiankaegy fabiankaegy added [Type] Bug An existing feature does not function as intended Backport to WP 6.6 Beta/RC Pull request that needs to be backported to the WordPress major release that's currently in beta Global Styles Anything related to the broader Global Styles efforts, including Styles Engine and theme.json labels Jun 3, 2024
@fabiankaegy
Copy link
Member Author

CC: @richtabor as I know you worked on this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Backport to WP 6.6 Beta/RC Pull request that needs to be backported to the WordPress major release that's currently in beta Global Styles Anything related to the broader Global Styles efforts, including Styles Engine and theme.json [Type] Bug An existing feature does not function as intended
1 participant