Skip to content

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

@kveeti

Description

@kveeti

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions