Skip to content

Cant disable console warnings if using css variables in tailwind.config.js #6

@KirillUshakov

Description

@KirillUshakov

Hi!
If i use css variables in my tailwind.config.js (theme.extend.colors) & i got many console warnings on project's build. Its so annoying and i cant disable it, because there is no options in the plugin. Could you fix that for css variables ?

Warnings:
image

Colors part in Tailwind.config.js:

  theme: {
    extend: {
        colors: {
            primary: {
                DEFAULT: "var(--c-primary)",
            },
            accent: {
                DEFAULT: "var(--c-accent)",
            },
            surface: {
                DEFAULT: "var(--c-surface)",
            },
       }
    }
  }

The problem happends in func getStyleRule in functions.js
There is a code:

getStyleRule: (inputColor) => {
        if (["transparent", "currentColor"].includes(inputColor)) {
            return {
                "--ta-column-rule-color": inputColor,
            };
        }
        try {
            const color = hexRgb(inputColor);

            return {
                "--ta-column-rule-color": `rgba(${color.red}, ${color.green}, ${color.blue}, var(--ta-column-rule-opacity))`,
            };
        } catch (error) {
            console.info(
                "Tailwind CSS Plugin Multi Column - not rendered color: ",
                inputColor
            );
        }
    },

I really hope you'll hear me and could help :)

Metadata

Metadata

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions