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.06.09.15.20.24
  • github.​com
  • 2 months ago
  • 1 hour ago
  • 4 years ago

Installs

  • Total 271K
  • Win 185K
  • OS X 58K
  • Linux 27K
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 Jul 7 Jul 6 Jul 5 Jul 4 Jul 3 Jul 2 Jul 1 Jun 30 Jun 29 Jun 28 Jun 27 Jun 26 Jun 25 Jun 24 Jun 23 Jun 22 Jun 21 Jun 20 Jun 19 Jun 18 Jun 17 Jun 16 Jun 15 Jun 14 Jun 13 Jun 12
Windows 82 219 228 236 128 130 211 243 251 291 335 216 157 224 216 232 210 226 148 132 192 226 222 238 261 124 153 188 243 220 229 238 116 139 179 213 219 234 218 150 143 202 220 190 219 258
OS X 15 35 38 43 28 25 34 52 43 59 78 26 27 43 51 35 44 44 20 26 49 37 57 51 59 16 33 49 35 49 52 57 21 40 49 46 43 47 54 20 26 50 39 56 48 45
Linux 3 24 26 23 22 20 27 21 19 28 32 11 13 19 24 19 15 19 14 12 22 31 22 28 24 19 20 18 21 23 18 15 16 14 16 30 25 21 20 10 20 19 25 21 35 35

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 4+ 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)

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