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

Autoprefixer

by sindresorhus ST2/ST3 Top 100

Sublime plugin to prefix your CSS

Details

  • 2017.03.16.11.06.31
  • github.​com
  • 1 month ago
  • 40 minutes ago
  • 4 years ago

Installs

  • Total 251K
  • Win 171K
  • OS X 55K
  • Linux 26K
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 Apr 11 Apr 10 Apr 9 Apr 8 Apr 7 Apr 6 Apr 5 Apr 4 Apr 3 Apr 2 Apr 1 Mar 31 Mar 30 Mar 29 Mar 28 Mar 27 Mar 26 Mar 25 Mar 24 Mar 23 Mar 22 Mar 21 Mar 20 Mar 19 Mar 18 Mar 17 Mar 16 Mar 15 Mar 14 Mar 13 Mar 12 Mar 11
Windows 168 214 147 165 213 210 224 191 207 145 151 205 222 234 228 241 180 162 201 255 226 172 164 128 166 231 235 279 264 278 152 150 221 220 232 236 243 176 163 240 250 274 263 301 170 174
OS X 35 59 33 30 26 50 49 49 43 18 28 36 55 76 52 58 40 31 36 56 48 44 51 29 33 58 62 58 63 65 32 41 52 64 45 60 65 38 56 56 62 70 69 79 39 45
Linux 19 18 16 11 25 23 24 19 31 16 15 27 28 37 31 16 16 26 21 26 28 25 26 21 27 29 21 23 23 28 13 20 28 37 27 34 19 25 17 21 24 34 31 24 22 21

Readme

Source
raw.​githubusercontent.​com

sublime-autoprefixer

Sublime plugin to prefix your CSS or SCSS

You shouldn't have to care about vendor prefixes. Now you don't have to!


Support this project & level up your Sublime skills with this excellent Sublime Power User course by Wes Bos
Try his free JavaScript 30 course for a taste of what to expect. Also check out his ES6 and React course.


Adding prefixes manually is a chore. It's also hard to keep track of where and which prefixes are needed. This plugin uses the Autoprefixer module to prefix properties and values according to the Can I Use database. Which means it will only add the necessary prefixes and not bloat your stylesheet. It even lets you specify what browsers you want to target. In addition it will remove existing prefixes which are no longer needed.

Works with CSS and SCSS, but not other preprocessors.

Install

Install Autoprefixer with Package Control and restart Sublime.

You need to have Node.js >=0.12.0 installed.
Make sure it's in your $PATH by running node --version in your command-line.
On macOS you need to make sure it's in /usr/local/bin or symlink it there.

See the Autoprefixer version in use here.

Getting started

In a CSS file, open the Command Palette (Cmd Shift P) and choose Autoprefix CSS. You can alternatively create one or more selections before running the command to only prefix those parts.

Options

(Preferences → Package Settings → Autoprefixer → Settings - User)

You can specify which browsers you need to support using an array of rules.

See the supported browser names.

Default

{
    "browsers": ["defaults"],
    "prefixOnSave": false
}

Example

{
    "browsers": ["last 1 version", "> 10%", "> 5% in US", "ie 8", "ie 7"]
}

This will add the needed prefixes for the last version of each browser, all browsers with market share of more than 10% globally and 5% in the US, and Internet Explorer 7 and 8.

Keyboard shortcut

You can also set up a keyboard shortcut to run the command by opening up “Preferences → Key Bindings - User” and adding your shortcut with the autoprefixer command.

Example:

[
    {
        "keys": ["alt+super+p"],
        "command": "autoprefixer"
    }
]

Project settings

You can override the default and user settings for individual projects. Just add an "Autoprefixer" object to the "settings" object in the project's .sublime-project file containing your project specific settings.

Example:

{
    "settings": {
        "Autoprefixer": {
            "browsers": ["last 1 version"]
        }
    }
}

License

MIT © Sindre Sorhus