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

Extending components using @extend


You can read more about the @extend directive in the Utilizing the @extend directive recipe of Chapter 4, Nested Selectors and Modular CSS. In this recipe, you will see how to use this directive to make all images in your Bootstrap project responsive by default.

Getting ready

You can edit the Bootstrap source Sass files with a text editor. You also have to install Bootstrap and learn how to recompile it. Read the Downloading and installing Bootstrap recipe of this chapter to find out how to install Bootstrap and recompile the Bootstrap CSS code.

How to do it...

In Bootstrap 4, images can be made responsive by adding the .img-fluid to the img tag in your HTML. You can use the following steps to make your images responsive by default:

  1. Before you start, install Bootstrap as described in the Downloading and installing Bootstrap recipe of this chapter.

  2. Then, open the scss/bootstrap.scss file and write the following lines of SCSS code at the end of this file:

    img...