O'Reilly logo

Sass and Compass Designer's Cookbook by Bass Jobsen

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Automatically prefixing your code with Grunt

Browser-specific prefixes can make CSS3, and therefore, Sass code, complex and more difficult to maintain. Mixins (prebuilt), such as Compass, offer you the opportunity to write single line declarations for properties, such as gradients and shadows. The autoprefixer plugin can prefix your code automatically; it uses the Can I Use database (available at http://caniuse.com/) in order to find the prefixes that meet your requirements. In this recipe, you will not directly use the autoprefix plugin, which is depreciated now in favor of the grunt-postcss plugin.

Getting ready

The only requirement for this recipe is to have the grunt-postcss plugin installed and loaded in your Gruntfile.js file. If you have ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required