ctrl+shift+p filters: :st2 :st3 :win :osx :linux
Browse

Clean​CSS

by stolksdorf ALL

CSS beautifier and sorter for Sublime text 2

Details

Installs

  • Total 15K
  • Win 9K
  • Mac 5K
  • Linux 1K
May 26 May 25 May 24 May 23 May 22 May 21 May 20 May 19 May 18 May 17 May 16 May 15 May 14 May 13 May 12 May 11 May 10 May 9 May 8 May 7 May 6 May 5 May 4 May 3 May 2 May 1 Apr 30 Apr 29 Apr 28 Apr 27 Apr 26 Apr 25 Apr 24 Apr 23 Apr 22 Apr 21 Apr 20 Apr 19 Apr 18 Apr 17 Apr 16 Apr 15 Apr 14 Apr 13 Apr 12
Windows 5 5 4 3 2 1 7 2 1 2 1 3 6 5 1 2 2 5 5 2 11 2 10 5 4 2 4 6 4 0 1 2 0 3 3 8 2 3 5 5 4 1 6 3 2
Mac 3 0 1 0 1 0 1 1 0 0 0 1 2 3 2 1 3 1 1 0 2 3 3 1 0 0 1 2 1 2 0 2 1 2 0 1 1 0 1 0 2 2 0 1 1
Linux 0 1 1 0 1 0 0 1 1 0 0 0 0 0 1 0 0 0 0 0 1 1 1 1 1 0 0 0 0 2 0 0 0 0 0 0 0 0 0 0 0 0 2 0 0

Readme

Source
raw.​githubusercontent.​com

CleanCSS is a Sublime Text 3 package for beautifying your CSS. CleanCSS indents all your rules properly, aligns all the values by the colon, and sorts each property into categories within each rule:

  • Imports (for LESS)
  • Variables (for LESS)
  • Mixins (for LESS)
  • Content
  • Positional
  • Dimensional
  • Appearance
  • Animation

Installation

CleanCSS is on Package Control, so just open the Command Palette and select “Package Control: Install Package”, then search for CleanCSS and you're done!

Usage

You can clean a css file by accessing the CleanCSS command from the command palette

or you can bind a key to the clean_css command in Preferences -> Key Bindings - User for ultra fast cleaning

{"keys":["f6"], "command" : "clean_css"},

Configuration

You can access the configuration settings by selecting Preferences -> Package Settings -> CleanCSS.

  • add_space_between_categories (Boolean) If true, then an empty line will be inserted between categories
  • add_space_between_rules (Boolean) Adds spaces inbetween each css rule.
  • indent_string (String) The string of characters used to indent. Defaults to a tab.
  • min_styles_to_collaspe (Number) If the rule has equal to or less styles, it won't add the category spacing. Defaults to 3.
  • vertically_align_selector_property_values (Boolean) If true, will align the colons of each style within each rule
  • categories (Array) Contains how CleanCSS should sort and group each CSS property. Feel free to customize this as you like. Ordering of the properities in here will dictate how the properties are ordered when you clean the file.