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

Adding Compass to your Ruby on Rails setup


Compass is a Sass library with prebuilt functions and mixins. In this recipe, you will learn how to use Compass for your RoR applications.

Getting ready

Read Chapter 6, Using Compass, of this book to learn more about Compass and also read the Hello world with Ruby on Rails recipe of this chapter to find out how to set up a RoR web application.

How to do it...

Learn how to add Compass to your RoR set up:

  1. Create a new Rails app by running the following command in your console:

    rails new recipe3
    
  2. Run, as already described in the Hello world with Ruby on Rails recipe, the controller generator and tell it that you want a controller called welcome with an action called index, using the following command:

    bin/rails generate controller welcome index
    
  3. Then add the compass-rails gem line to your application's Gemfile, as follows:

    gem 'compass-rails'
    
  4. Don't forget to run the bundle command in your console after the previous step.

  5. Change your application.css file to...