Tailwind CSS Formatter is a Visual Studio Code extension that helps you format Tailwind CSS classes by grouping them into lines with a configurable maximum character length (default is 50 characters per line).
Features
Formats selected Tailwind CSS classes.
Groups classes into lines with a configurable maximum character length.
Default maximum characters per line is set to 50, but it can be customized.
Installation
Install Dependencies:
npm install
Open in VSCode:
code .
Run the Extension:
Press F5 to open a new VSCode window with the extension loaded.
Usage
Select the text containing Tailwind CSS classes you want to format.
Open the Command Palette (Ctrl+Shift+P or Cmd+Shift+P on Mac).
Run the Format Tailwind CSS command.
The selected Tailwind CSS classes will be formatted, grouping them into lines based on the maximum character length configuration.
Configuration
You can configure the maximum number of characters per line in the settings:
Go to File > Preferences > Settings (or Code > Preferences > Settings on Mac).
Search for Tailwind CSS Formatter.
Set the Maximum number of characters per line when formatting Tailwind CSS classes to your desired value.