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

Applying the grid on your design


In this recipe, you will learn how to build a layout using the flexbox code you have already built in the preceding recipes of this chapter.

Getting ready

Read Chapter 1, Getting Started with Sass to find out how to compile your CSS code using Ruby Sass. You will reuse the code from the Building a grid with grid classes recipe of this chapter.

How to do it...

You need to perform the following steps to apply the grid on your design:

  1. Copy the files of the Building a grid with grid classes recipe of this chapter into your working directory. Your file and directory structure should look like that shown in the following figure:

  2. Now edit the sass/layout/_grid.scss file. Write down the following SCSS code at the end of this file:

    @mixin make-cols($grid) { 
      @for $col-number from 1 through $grid-columns {
        @include make-column($grid, $col-number);
      } 
    }
    
    @include make-cols(xs);
    
    @media (min-width: $sm-breakpoint) {
      @include make-cols(sm);
    }
    
    @media (min-width: ...