tw-in-js / vscode-twind-intellisense

Intelligent Twind tooling for VS Code
MIT License
60 stars 10 forks source link

Using string interpolated variables in twind.config.ts breaks some functionality #13

Open veeti-k opened 2 years ago

veeti-k commented 2 years ago

This config will break plugin intellisense:

import { blue } from "twind/colors";

const config: Configuration = {
  mode: "strict",
  theme: {
    extend: {
      boxShadow: {
        test: `0 0 0 4px ${blue[400]}`,
      },
    },
  },
  plugins: {
    btn: `
      bg-blue-700
      hover:shadow-test
      p-3
      rounded-md
      text-white
      transition-shadow
    `,
  },
};

image

If the test boxShadow is changed to

boxShadow: {
  test: `0 0 0 4px blue`,
}, 

plugin intellisense starts working again.

image

Even when the intellisense thinks something's wrong, the shadow will have the right color. And it doesn't matter if the shadow is used in any plugin, as long as it's in the config, it breaks the intellisense.

Here's a repro repo: https://github.com/veeti-k/twind-intellisense-repro