Skip to content
| Marketplace
Sign in
Visual Studio Code>Formatters>CSS Format ST3New to Visual Studio Code? Get it now.
CSS Format ST3

CSS Format ST3

idreamsoft

|
2,326 installs
| (2) | Free
CSS Format is a CSS formatting plugin for Sublime Text, you can convert CSS/SASS/SCSS/LESS code to Expanded, Compact or Compressed format. CSS Format is just only a formatter, do not supports grammar check and auto correct feature.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

css-format-st3

This extension is converted from Sublime-CSS-Format (https://github.com/mutian/Sublime-CSS-Format).

Example:

  • Expanded:

    body {
        background: #fff;
        font: 12px/2em Arial, Helvetica, sans-serif;
    }
    ol, ul, li {
        margin: 0;
        padding: 0;
    }
    a {
        color: rgba(65, 131, 196, 0.8);
    }
    
  • Expanded (Break Selectors):

    body {
        background: #fff;
        font: 12px/2em Arial, Helvetica, sans-serif;
    }
    
    ol,
    ul,
    li {
        margin: 0;
        padding: 0;
    }
    
    a {
        color: rgba(65, 131, 196, 0.8);
    }
    
  • Compact:

    body { background: #fff; font: 12px/2em Arial, Helvetica, sans-serif; }
    ol, ul, li { margin: 0; padding: 0; }
    a { color: rgba(65, 131, 196, 0.8); }
    
  • Compact (No Spaces):

    body{background:#fff;font:12px/2em Arial,Helvetica,sans-serif;}
    ol,ul,li{margin:0;padding:0;}
    a{color:rgba(65,131,196,0.8);}
    
  • Compact (Break Selectors):

    body { background: #fff; font: 12px/2em Arial, Helvetica, sans-serif; }
    ol,
    ul,
    li { margin: 0; padding: 0; }
    a { color: rgba(65, 131, 196, 0.8); }
    
  • Compact (Break Selectors, No Spaces):

    body{background:#fff;font:12px/2em Arial,Helvetica,sans-serif;}
    ol,
    ul,
    li{margin:0;padding:0;}
    a{color:rgba(65,131,196,0.8);}
    
  • Compressed:

    body{background:#fff;font:12px/2em Arial,Helvetica,sans-serif}ol,ul,li{margin:0;padding:0}a{color:rgba(65,131,196,0.8)}
    

Extension Settings

This extension contributes the following settings:

  • cssFormatSt3.formattingAction: Document Formatting Action.
  • cssFormatSt3.indentation: Format indentation, you can set it to " ". By default, this is set to "\t".
  • cssFormatSt3.expandBlockBreak: Set the line breaks after each rules block under Expanded format. By default, this is set to "\n\n"..
  • cssFormatSt3.formatOnSave: Set to true to trigger format on save. By default, this is set to false.
  • cssFormatSt3.formatOnSaveAction: Format action. You can refer to Settings - Default. By default, this is set to "expand".
  • cssFormatSt3.formatOnSaveFilter: CSS Format matches the type of the file being saved against this defined to determine if a build should be triggered. By default, the setting has a value of "css|sass|scss|less".

keyboard shortcuts

  • Expanded (cmd+alt+f e on macOS or ctrl+alt+f e on Windows and Linux).
  • Compact (cmd+alt+f c on macOS or ctrl+alt+f c on Windows and Linux).
  • Compressed (cmd+alt+f s on macOS or ctrl+alt+f s on Windows and Linux).

Author

Created by Mutian (http://mutian.wang).

Enjoy!

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