Using vendor prefixes
In this recipe, you will learn how to create cross-browser background gradients with Sass using vendor prefixes.
Getting ready
Also, read the Writing mixins with arguments recipe of Chapter 3, Variables, Mixins, and Functions. Of course, you will need the Ruby Sass compiler for this. The Installing Sass for command line usage recipe of Chapter 1, Getting Started with Sass, describes how to install Ruby Sass on your system.
How to do it...
Learn how to create cross-browser background gradients with Sass by performing the following steps:
Create your main project file called
main.scss
. This file should import the gradient partial file. So, themain.scss
should contain a SCSS code like that shown here:// scss-lint:disable ColorKeyword, ColorVariable @import 'components/gradients'; header { @include gradient-horizontal(yellow, green); color: white; padding: 20px; }
The gradient partial, the
components/_gradients.scss
file, should contain the mixin that creates your background...