Book Image

Sass and Compass Designer's Cookbook

By : Bass Jobsen, Stuart Robson
Book Image

Sass and Compass Designer's Cookbook

By: Bass Jobsen, Stuart Robson

Overview of this book

Sass and Compass Designer's Cookbook helps you to get most out of CSS3 and harness its benefits to create engaging and receptive applications. This book will help you develop faster and reduce the maintenance time for your web development projects by using Sass and Compass. You will learn how to use with CSS frameworks such as Bootstrap and Foundation and understand how to use other libraries of pre-built mixins. You will also learn setting up a development environment with Gulp. This book guides you through all the concepts and gives you practical examples for full understanding.
Table of Contents (23 chapters)
Sass and Compass Designer's Cookbook
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Using placeholder selectors with the @extend directive


Placeholder selectors in Sass enable you to create selectors that can be extended but never outputted into the compiled CSS code.

Getting ready

This recipe reuses the code from the fourth step of the Utilizing the @extend directive recipe of this chapter. You can use the Ruby Sass compiler, as described in the Installing Sass for command line usage recipe of Chapter 1, Getting Started with Sass, to compile the Sass code in this recipe into CSS code.

How to do it...

After performing the following steps you have learn how to use placeholder selectors in your Sass code to avoid unused selectors in the compiled CSS code:

  1. Copy the SCSS code from the fourth step of the Utilizing the @extend directive recipe of this chapter. In this SCSS, replace the .button selector three times with the %button placeholder selector. Now, your code should like that shown here:

     // scss-lint:disable ColorKeyword
    
    $default-color: red;
    $warning-color: orange;
    
    %button...