-
Book Overview & Buying
-
Table Of Contents
Sass and Compass for Designers
By :
Compass has gained fast and fervent favor with developers as it enables authors to write a mixin using a single syntax that, on compile, generates a full vendor-prefixed 'stack' of properties in the CSS. This has been particularly useful with experimental CSS properties, often referred to in recent years as CSS3.
CSS actually gets developed in modules so it is often possible that some modules are further along than others. Selectors, for example, is already a level 4 working draft specification: http://www.w3.org/TR/selectors4/.
Let's look at some of these common experimental properties and how we can produce cross-browser code with a relevant Compass mixin.
First up, text-shadow.
Text shadow is actually well supported in all modern browsers (Internet Explorer 9 being a notable exception), so Compass won't generate a vendor-prefixed stack for it (it's smart enough to know it isn't needed). Despite this, let's use a Compass mixin to include...
Change the font size
Change margin width
Change background colour