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

What mixins are and how we can use them to easily produce oft-needed code


Nesting @extend and placeholder selectors are very convenient but they don't actually produce extra code. Mixins on the other hand do. Those readers who have been unfortunate enough to use Microsoft Word or Excel may have used macros. If so, think of mixins like macros.

Typically, a mixin is defined once, then included elsewhere in the Sass file and passed any optional arguments. Then, on compilation, it generates the relevant code.

That sounds pretty complicated and "programmer-ish". If such talk makes your palms go a little sweaty or your eyes glaze over, don't worry.

Compass has literally hundreds of ready-made mixins that address every conceivable CSS need. Don't want to dabble in writing mixins? Just use the ones that Compass provides; enjoy cross-browser compatibility that makes you feel heroic and thank the Compass team with a donation to the Compass's charityware cause: http://umdf.org/compass

However, for the...