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

Playing on SassMeister


SassMeister is a project of Jed Foster and Dale Sande. SassMeister is a playground for Sass, Compass, and LibSass. You can easily test and share your Sass code on SassMeister. In this recipe, you will be introduced to SassMeister.

Getting ready

For this recipe, you will only need a web browser to visit SassMeister at http://sassmeister.com.

How to do it...

The steps below demonstrate you how to test your code on the SassMeister playground for Sass:

  1. In your browser, navigate to http://sassmeister.com.

  2. You can directly start using SassMeister or you can log in with your GitHub account.

  3. Write down the following SCSS code in the upper-left SCSS input area of SassMeister:

    @mixin set-width($width) {
      @if $width < 50 {
        @error "width should be >= 50";
        $width: 1px * $width;
      }
      @if unit($width) not "px" {
        @warn "width (#{$width}) converted to pixels";
        $width: 1px * $width;
      }
      $width: $width * 10;
      @debug "width: #{$width}";
      width: $width;
    }
    
    div {
     ...