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

CSS Filters


Compass provides a mixin to produce a vendor-prefixed stack of properties for CSS Filters. The syntax follows the W3C specification described here at http://www.w3.org/TR/filter-effects/.

Let's use the drop-shadow filter to solve our prior issue. We'll remove the existing box-shadow mixin and instead apply a CSS drop-shadow filter with the Compass mixin:

@include filter(drop-shadow(#ccc 1px 1px 0px));

And here is the effect in the browser:

Compass will let you apply all CSS filters in this manner, essentially following the W3C syntax for the relevant filter.

Tip

Be aware that filters are experimental at this stage so you may find, as in this instance, that it leads to blurring of the text. I'm therefore reverting to the rotated square with the box-shadow technique we used before.