-
Book Overview & Buying
-
Table Of Contents
-
Feedback & Rating
Sass and Compass Designer's Cookbook
By :
In this recipe, you will learn how to create cross-browser background gradients with Sass using vendor prefixes.
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.
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, the main.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...
Change the font size
Change margin width
Change background colour