Book Image

Sass and Compass for Designers

By : Ben Frain
Book Image

Sass and Compass for Designers

By: Ben Frain

Overview of this book

Table of Contents (17 chapters)
Sass and Compass for Designers
Credits
Foreword
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

A cautionary note about generated CSS


As noted in the first chapter, writing bad Sass will generate bad CSS. Overuse of nesting, @extend, and mixins can lead to bloated code and over-specific selectors. Therefore, apply the same level of common sense when writing Sass as you would when writing plain vanilla CSS (when I say vanilla CSS, I just mean normal CSS with no preprocessor involved in its creation). For example, only make rules as specific as they need to be, don't nest rules too deeply and don't repeat mixins unless necessary.

Getting the hang of writing Sass well from the outset is important. Using Sass and Compass to create CSS files means you will be less inclined to look at the final outputted CSS.

However, even if Sass and Compass don't generate CSS exactly as you would have written it by hand, remember that it is only the browser that actually consumes the compiled CSS (and at that point it should be compressed and illegible to humans anyway). Therefore as no human will actually...