Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prettier Plugin Tailwind within :ui={...} #776

Closed
UfukUstali opened this issue Oct 3, 2023 · 3 comments · Fixed by tailwindlabs/prettier-plugin-tailwindcss#225
Closed
Labels
question Further information is requested

Comments

@UfukUstali
Copy link

Description

Does the prettier-plugin-tailwindcss (which sorts the tailwind classes for a consistent look) work within the :ui={...} props?

I did follow the installation guide in the NuxtUI website this is what my .vscode/settings.json looks like

{
  "files.associations": {
    "*.css": "tailwindcss"
  },
  "editor.quickSuggestions": {
    "strings": true
  },
  "tailwindCSS.experimental.configFile": "tailwind.config.ts",
  "tailwindCSS.experimental.classRegex": [
    ["ui:\\s*{([^)]*)\\s*}", "[\"'`]([^\"'`]*).*?[\"'`]"],
    ["/\\*ui\\*/\\s*{([^;]*)}", ":\\s*[\"'`]([^\"'`]*).*?[\"'`]"]
  ],
  "tailwindCSS.classAttributes": ["class", "className", "ngClass", "ui"]
}

If so it might be issue with my setup.

If not feel free to change this to a feature request.

@UfukUstali UfukUstali added the question Further information is requested label Oct 3, 2023
@kamuiroeru
Copy link

+1

Copy link
Member

I've never used this but have you tried adding :ui instead of ui as shown here https://github.com/tailwindlabs/prettier-plugin-tailwindcss#sorting-non-standard-attributes for :class?

@UfukUstali
Copy link
Author

It did not work unfortunately. I did upgrade to the latest versions of both prettier 3.0.3 and the prettier-plugin-tailwindcss 0.5.6. I have used what was recommended both this Sorting non-standard attributes and this Sorting classes in function calls (by themselves and together with both with ui and :ui).

module.exports = {
  trailingComma: "all",
  tabWidth: 2,
  semi: true,
  plugins: ["prettier-plugin-tailwindcss"],
  tailwindAttributes: ["ui", ":ui"],
  tailwindFunctions: ["ui", ":ui"],
};

I did add :ui to here inside the settings.json file hoping that would do change something it did not.

"tailwindCSS.classAttributes": ["class", "className", "ngClass", "ui"]

I will open an issue with the prettier-plugin-tailwindcss as well after this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants