Skip to content

Configuration for mixed dot-notation and factory-function tagged templates #1546

@behnammodi

Description

@behnammodi

What version of VS Code are you using?

1.109.0

What version of Tailwind CSS IntelliSense are you using?

v0.14.29

What version of Tailwind CSS are you using?

4.1.18

What package manager are you using?

yarn

What operating system are you using?

macOS

Tailwind CSS Stylesheet (v4) or config file (v3)

@import "tailwindcss";

VS Code settings

{
    "github.copilot.nextEditSuggestions.enabled": true,
    "workbench.iconTheme": "vscode-icons",
    "workbench.colorTheme": "GitHub Dark Default",
    "gitlens.ai.model": "vscode",
    "gitlens.ai.vscode.model": "copilot:gpt-4.1",
    "tailwindCSS.classFunctions": [
        "tailwindy\\.\\w+",
        "tailwindy\\(w+\\)",
    ]
}

Reproduction URL

Code Example:

import tailwindy from 'tailwindy-components';

export const BaseButton = tailwindy.div`text-2xl text-red-500`

export const PrimaryButton = tailwindy(BaseButton)`bg-blue-500 text-white`

Settings.json

{
    "tailwindCSS.classFunctions": [
        "tailwindy\\.\\w+",
        "tailwindy\\(w+\\)",
    ]
}

Describe your issue

I am using a utility library (tailwindy-components) similar to styled-components, that allows defining Tailwind components using two different syntax patterns:

Dot notation:

tailwindy.div`text-2xl text-red-500`

Factory/Function notation:

tailwindy(Component)`bg-blue-500 text-white`

I am trying to configure the VS Code extension to provide IntelliSense for both patterns simultaneously, but I am struggling to find a regex configuration that covers both cases or allows them to coexist without breaking one another.

Reproduction / Code Examples

JavaScript
// Pattern 1: Dot notation

import tailwindy from 'tailwindy-components';
export const BaseButton = tailwindy.div`text-2xl text-red-500`;

// Pattern 2: Function notation (wrapping another component)
export const PrimaryButton = tailwindy(BaseButton)`bg-blue-500 text-white`;

What I've Tried I have attempted to add regex patterns to the configuration, such as:

tailwindy\.\w+ (Works for dot notation)

tailwindy\(w+\) (Works for function notation)

Question Is there a recommended regex pattern or configuration approach to support both of these tagged template styles simultaneously?

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