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

Building a semantic grid with mixins


In the Building a grid with grid classes recipe of this chapter, you can read how to build a grid with CSS grid classes. Using these grid classes on the div elements breaks the semantic nature of HTML5. In this recipe, you will learn how to keep the HTML5 semantic tags intact when deploying a grid.

Getting ready

In this recipe, you will have to use the code from the Building a grid with grid classes and Creating responsive grids recipes of this chapter. You will use the Ruby Sass compiler as described in Chapter 1, Getting Started with Sass, to compile your CSS code.

How to do it...

Learn how to set up a semantic grid by performing the step beneath:

  1. Leverage the SCSS code from the Building a grid with grid classes and Creating responsive grids recipes, and edit the sass/layout/_grid.scss file so that it contains the following SCSS code:

    @mixin set-span($col-number) {
      flex-basis: ((100% / $grid-columns) * $col-number);
      max-width: ((100% / $grid-columns...