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

Duotone: Presets with custom variables don't work #52875

Closed
hanneslsm opened this issue Jul 24, 2023 · 2 comments
Closed

Duotone: Presets with custom variables don't work #52875

hanneslsm opened this issue Jul 24, 2023 · 2 comments
Labels
[Feature] Colors Color management Needs Testing Needs further testing to be confirmed. [Type] Bug An existing feature does not function as intended

Comments

@hanneslsm
Copy link

hanneslsm commented Jul 24, 2023

Description

When defining a duotone palette in the theme.json but using colors from the color palette, those duotone filters won't work then. (the name is also not correctly displayed as in here #52733)

Step-by-step reproduction instructions

  1. Define colors in your theme.json
  2. Try to use those colors for duotone filters

Screenshots, screen recording, code snippet

image
  "settings": {
    "appearanceTools": true,
    "color": {
      "duotone": [
        {
          "colors": [
            "var(--wp--preset--color--light)",
            "var(--wp--preset--color--dark)"
          ],
          "name": "Light",
          "slug": "light"
        },
        {
          "colors": [
            "var(--wp--preset--color--dark)",
            "var(--wp--preset--color--light)"
          ],
          "name": "Dark",
          "slug": "dark"
        },
        {
          "colors": [
            "var(--wp--preset--color--primary-90)",
            "var(--wp--preset--color--primary-120)"
          ],
          "name": "Primary 90",
          "slug": "primary-110"
        }

…

However, it is possible to select from the color palette in the editor:
image

Environment info

  • Wp 6.2.2
  • GB 16.2.1

Please confirm that you have searched existing issues in the repo.

No

Please confirm that you have tested with all plugins deactivated except Gutenberg.

Yes

@hanneslsm hanneslsm changed the title Duotone: custom variables won't work Duotone: Presets with custom variables don't work Jul 24, 2023
@carolinan carolinan added the [Feature] Colors Color management label Jul 24, 2023
@jordesign jordesign added [Type] Bug An existing feature does not function as intended Needs Testing Needs further testing to be confirmed. labels Jul 26, 2023
@Olein-jp
Copy link
Contributor

I was thinking exactly the same thing.

I find it quite useful to be able to set the colours of the colour palette defined in theme.json with CSS variables, so that I can control the colour scheme even when switching between Style Variations.

@ajlende
Copy link
Contributor

ajlende commented Aug 2, 2023

This is a duplicate of #33905

@ajlende ajlende closed this as completed Aug 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Colors Color management Needs Testing Needs further testing to be confirmed. [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

No branches or pull requests

5 participants