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

Extending the mixins with your own mixins


You can easily extend Bootstrap with your own mixins. In this recipe, you will see how to do this.

Getting ready

Install Bootstrap as described the Downloading and installing Bootstrap recipe of this chapter. You can use a text editor to edit the SCSS code. In the There's more… section of this recipe, the Sass version of Dan Eden's Animate.css will be used.

How to do it...

Perform the following steps:

  1. Before you start, install Bootstrap as described in the Downloading and installing Bootstrap recipe of this chapter.

  2. Create a Sass partial file called _figures.scss and write the following SCSS code into this file:

    @mixin figures() {
      article {
        figure {
          @include center-block();
          > img {
            @include img-fluid();
          }
    
          @include media-breakpoint-up(md) {
            max-width:50%;
            @include pull-right();
          }
        }   
      @include clearfix();
      }
    }
    
    #maincontent {
      @include figures();
    }
  3. Then, open the scss/bootstrap.scss...