Skip to content

Intellisense not working after regex containing <style> tag #929

Closed
@Kenrick0

Description

@Kenrick0

What version of VS Code are you using?
v1.87.2

What version of Tailwind CSS IntelliSense are you using?
v0.10.5

What version of Tailwind CSS are you using?
v3.4.1

What package manager are you using?
pnpm

What operating system are you using?
Ubuntu

Tailwind config

import type { Config } from "tailwindcss";

export default {
  content: ["./{pages,layouts,components,src}/**/*.{html,js,jsx,ts,tsx,vue,mdx}"],
  theme: {
    extend: {},
  },
  plugins: [],
} satisfies Config;

Reproduction

Save the below code as a file with a tsx extension in a react project.

export default function Page() {
    let styles = "html string".match(/<style>[\s\S]*?<\/style>/m)

    return <div className="border-gray-200">{styles}</div>
}

Describe your issue

There are no tailwindcss-intellisense suggestions/highlighting in the div className, I suspect the style tag in the regex is confusing the extension. I expected intellisense to work as normal.
image

If I remove the regex suggestions/hints start working:
image

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