question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cannot seem to get sortTailwindcssClasses working in VSCode

See original GitHub issue

I cannot seem to get the Tailwindcss auto sorting working in VSCode. On save it does seem to use the prettier-plugin-blade package.

I’m testing this by juggling some Tailwind classes in my blade template into a random order. What am I doing wrong?

{
	"semi": true,
	"singleQuote": true,
	"trailingComma": "es5",
	"printWidth": 150,
	"useTabs": true,
	"tabWidth": 1,
	"plugins": ["@shufo/prettier-plugin-blade"],
	"overrides": [
		{
			"files": ["*.blade.php"],
			"options": {
				"parser": "blade",
				"printWidth": 999,
				"sortTailwindcssClasses": true,
				"wrapAttributes": "auto",
				"sortHtmlAttributes": "none",
				"noPhpSyntaxCheck": false
			}
		}
	]
}

Saving a .blade.php file

["INFO" - 3:47:23 PM] Prettier Options:
{
  "filepath": "/mypath/resources/views/vp-account-settings.blade.php",
  "parser": "blade",
  "useTabs": true,
  "tabWidth": 1,
  "endOfLine": "lf",
  "semi": true,
  "singleQuote": true,
  "trailingComma": "es5",
  "printWidth": 999,
  "plugins": [
    "/mypath/node_modules/@shufo/prettier-plugin-blade/dist/index.js"
  ],
  "sortTailwindcssClasses": true,
  "wrapAttributes": "auto",
  "sortHtmlAttributes": "none",
  "noPhpSyntaxCheck": false
}
["INFO" - 3:47:23 PM] Formatting completed in 139ms.```

Issue Analytics

  • State:open
  • Created 10 months ago
  • Reactions:1
  • Comments:9 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
shufocommented, Nov 24, 2022

Thanks for creating the issue. I’ll look into it.

0reactions
yabdabcommented, Dec 13, 2022

Any progress in this?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Automatic Class Sorting with Prettier
This means that any classes in the base layer will be sorted first, followed by classes in the components layer, and then finally...
Read more >
My TailWind CSS Intellisense plugin just isn't working on ...
I'm using tailwindcss in a react app. Tailwindcss Intellisense plugin was not working in my VSCode but then i installed HTML CSS Support ......
Read more >
Sorting not working with postcss in VSCode · Issue #186
Trying to sort classes in a .css / .pcss file does not work with ... Open the VSCode command pallet and run >Headwind:...
Read more >
Sorting Tailwind CSS Classes Automatically with Prettier
In this video, I'll show you how to set up Prettier and the new Prettier plugin for Tailwind CSS, which will sort your...
Read more >
Enable Automatic Tailwind Class Sorting in 4 Minutes
For anyone looking to sort Tailwind classes in Blade files, I found this Prettier plugin that worked great for me: https://github.com/shufo/ ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found