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

Clean​CSS

by stolksdorf ST2/ST3

CSS beautifier and sorter for Sublime text 2

Details

Installs

  • Total 14K
  • Win 9K
  • OS X 4K
  • Linux 1K
Aug 22 Aug 21 Aug 20 Aug 19 Aug 18 Aug 17 Aug 16 Aug 15 Aug 14 Aug 13 Aug 12 Aug 11 Aug 10 Aug 9 Aug 8 Aug 7 Aug 6 Aug 5 Aug 4 Aug 3 Aug 2 Aug 1 Jul 31 Jul 30 Jul 29 Jul 28 Jul 27 Jul 26 Jul 25 Jul 24 Jul 23 Jul 22 Jul 21 Jul 20 Jul 19 Jul 18 Jul 17 Jul 16 Jul 15 Jul 14 Jul 13 Jul 12 Jul 11 Jul 10 Jul 9 Jul 8
Windows 1 2 4 2 0 1 4 2 2 0 3 1 4 4 6 6 6 3 1 1 3 3 2 4 3 1 1 4 5 5 2 3 1 1 1 2 4 5 4 6 0 5 0 9 1 2
OS X 0 2 1 2 0 0 0 0 0 1 0 0 0 1 1 0 3 2 2 0 0 1 0 1 2 1 0 0 1 0 0 0 0 0 0 1 0 1 1 0 0 1 0 0 3 1
Linux 0 0 0 0 1 0 0 1 3 0 1 0 0 0 0 0 0 0 0 4 0 1 0 0 0 0 0 0 1 0 0 0 0 1 0 0 0 0 0 1 0 0 0 3 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.