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

Image sprites with Compass


CSS sprite images is a technique that dates back many years. All the website's images are added to a single image, the sprite. If the browser requests an image, the sprite will be loaded as the background image. CSS is used to show the requested image containing a part of the sprite. Loading one big sprite, which can be cached, instead of several small images will reduce the number of HTTP requests needed by the browser to show the page. The fewer the HTTP requests, the faster the page will load.

Getting ready

For this recipe, you have to install both Sass and Compass. Read the Installing Sass for command line usage and Installing Compass recipes of Chapter 1, Getting Started with Sass.

You will also need some PNG images and to create a file and directory structure like that shown in the following image:

How to do it...

Learn how to create image sprites for your projects with Sass and Compass by following the steps as shown:

  1. Create an images/logos folder in your project...