Skip to content
| Marketplace
Sign in
Visual Studio Code>Programming Languages>Attributes CollapseNew to Visual Studio Code? Get it now.
Attributes Collapse

Attributes Collapse

AKR OSS

|
2,658 installs
| (0) | Free
The extension is designed to automatically collapse className and class attributes in TSX, JSX, and HTML files to a single line, reducing the length of lines and making the code easier to read and navigate. This idea was inspired by the frustration that many developers using CSS frameworks like Tail
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Attributes Collapse

The extension is designed to automatically collapse className and class attributes in TSX, JSX, and HTML files to a single line, reducing the length of lines and making the code easier to read and navigate. This idea was inspired by the frustration that many developers using CSS frameworks like Tailwind CSS have expressed about the length of class names in their code.

Demo

demo

Configuration

attributes-collapse.attributes: string[]

Default value:

className class tw

attributes-collapse.enabledLanguageIds: string[]

Default value:

typescriptreact
javascriptreact
html
typescript
javascript
vue-html
vue
php
markdown
coffeescript
razor
ruby
rust

You can use command attributes-collapse.toggle to set a key binding to toggle the collapse.

e.g.

keybinding

Running the Extension

  • Run pnpm install in terminal to install dependencies
  • Run the Run Extension target in the Debug View. This will:
    • Start a task npm: watch to compile the code
    • Run the extension in a new VS Code window

Issues

If you find a bug in this project, we encourage you to file an issue on our GitHub repository.

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