Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>CSS/Tailwind OrderNew to Visual Studio Code? Get it now.
CSS/Tailwind Order

CSS/Tailwind Order

Abla Mohamed Amine

|
1 install
| (0) | Free
Sort CSS declarations and Tailwind utility classes using the 9elements semantic methodology
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

CSS/Tailwind Order

CSS/Tailwind Order Icon

CSS/Tailwind Order is a comprehensive VS Code extension designed to automatically sort and format your CSS declarations and Tailwind utility classes using the widely-adopted 9elements semantic methodology.

Keep your stylesheets and utility classes perfectly organized, readable, and consistent across your entire codebase with zero effort!

🚀 Features

  • 🎨 Semantic CSS Sorting: Sorts standard CSS, SCSS, and LESS declarations logically instead of purely alphabetically.
  • 💨 Tailwind CSS Support: Automatically sorts Tailwind utility classes in your HTML, JSX, TSX, Vue, Svelte, and PHP files.
  • ✨ @apply Directive Sorting: Sorts Tailwind classes inside @apply statements in your stylesheets.
  • 🔄 Format On Save: Automatically sort your styles when saving a file (configurable).
  • ⚙️ Highly Customizable: Retain custom properties (--var) at the top, push unknown properties to the bottom, and more.

💻 Commands

Access these commands through the Command Palette (Ctrl+Shift+P / Cmd+Shift+P):

  • CSS/Tailwind Order: Sort Everything in Document: Sorts both CSS declarations and Tailwind classes everywhere in the current file.
  • CSS/Tailwind Order: Sort CSS Declarations in Document: Sorts only CSS rules in the document.
  • CSS/Tailwind Order: Sort CSS Declarations in Selection: Sorts only the highlighted CSS rules.
  • CSS/Tailwind Order: Sort Tailwind Classes in Document: Sorts all Tailwind classes in the current markup document.
  • CSS/Tailwind Order: Sort Tailwind Classes in Selection: Sorts only the highlighted Tailwind classes.
  • CSS/Tailwind Order: Sort @apply Directives: Focuses strictly on sorting @apply lists in CSS/SCSS/LESS.

⚙️ Configuration Properties

You can customize the extension via your settings.json:

Setting Default Description
cssOrder.sortOnSave true Sort CSS declarations and Tailwind classes automatically on file save.
cssOrder.placeUnknownPropertiesLast true Place unrecognized CSS properties at the end of the block.
cssOrder.keepCustomPropertiesAtTop true Keep CSS custom properties (--variable) at the top of declaration blocks.
cssOrder.preserveDuplicates true Preserve relative order of duplicate property declarations.
cssOrder.sortApplyDirectives true Sort Tailwind utility classes inside @apply directives.
cssOrder.languageSupport ["css", "scss", "less"] Language IDs for CSS declaration sorting.
cssOrder.tailwind.enabled true Enable Tailwind class sorting feature.
cssOrder.tailwind.languageSupport ["html", "javascriptreact", "typescriptreact", "vue", "svelte", "php"] Language IDs that Tailwind sorting applies to.
cssOrder.tailwind.attributeNames ["class", "className", "class:list", "ngClass"] Attributes to scan for Tailwind classes.
cssOrder.tailwind.placeUnknownClassesLast true Place unrecognized Tailwind classes at the end of the class string.

🛠️ Supported Languages

CSS Declaration Sorting:

  • CSS (.css)
  • SCSS (.scss)
  • LESS (.less)

Tailwind Class Sorting:

  • HTML (.html)
  • React (.jsx, .tsx)
  • Vue (.vue)
  • Svelte (.svelte)
  • PHP (.php)

📝 License

This extension is licensed under the MIT License.

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2026 Microsoft