Wrote up a little CodePen to demo how Sass and Compass can help with theming.
This code is useful if you're writing a theme and want to easily change colours.
The problem, your design calls for multiple colour values. So in CSS you'd have to declare each of these values, for example.
Now, what if you want to create another theme that's red? That means, working out and changing all the colour values. Enter Sass.
Using variables such as:
Then calling them in your Sass file, you now only have to change one value to change all the values throughout the entire document.
Taking things a step further, you can also make use of Compass to handle all those vendor prefixes.
@include background-image(linear-gradient($base-light, $base-dark));
Browse by category:
- case study4
- chrome dev tools4
- clojure overtone2
- dev tips1
- raspberry pi1
- responsive web design1
- web development2