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

CSS3_Syntax

by y0ssar1an ST2

Sublime Text package for CSS3 syntax highlighting.

Details

Installs

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

Readme

Source
raw.​githubusercontent.​com

CSS3_Syntax

Announcement: For ST3 users, this package has been replaced by CSS3. This package will be removed some time after Sublime Text 3 is released.

Features

  • Comprehensive: near complete support for CSS3, based on the latest draft specs, support for many vendor-prefixed CSS extensions (e.g. -moz-, -ms-, -webkit-)
  • Forward-looking: support for upcoming features like variables, CSS animation, and @supports
  • Modern: deprecated or obsolete parts of CSS are flagged as such
  • Faithful: extremely close adherence to the W3C specification, with minor deviations due to technical limitations (for non-trivial deviations read below)

Installation

  1. Install Package Control
  2. Mac: cmd+shift+p → Package Control: Install Package → CSS3 Syntax
    Windows/Linux: ctrl+shift+p → Package Control: Install Package → CSS3 Syntax

After you've installed the plugin, open any CSS file and set the syntax to CSS. * Mac: cmd+shift+p → Set Syntax: CSS3
* Windows/Linux: ctrl+shift+p → Set Syntax: CSS3

Set CSS3 Syntax as Default

  • WARNING: This may break extensions that only recognize the default CSS syntax, such as Autoprefixr. A workaround, shown here, is to switch the syntax back to CSS when you want to run Autoprefixr.
  1. Open a CSS file in Sublime Text
  2. Navigate to View → Syntax → Open all with current extension as… → CSS3

After these steps, any CSS file you open in the future will be highlighted using CSS3 Syntax.

Limitations

  • No support for the following prefixes
-ah- -apple- -atsc- -hp- -ibooks-
-khtml- -mso- -o- -prince- -rim-
-ro- -tc- -weasy- -xv-
  • Incomplete support for vendor-prefixed CSS extensions (we're adding more as we find them)

Deviations from the Spec

All Properties Must End with a Semicolon

CSS doesn't require this, but it's a good practice. Semicolons help the highlighter distinguish properties and values. Without a semicolon, the highlighting could be off.

alt text

All Properties Must be Written in Lowercase

The spec says that HTML tags, properties, values, function names, and more should be matched case-insenstively. However, this syntax highlighter only matches lowercase text. If this bothers enough people, we can work to include matching uppercase text as well.

alt text