Theming With Sass And Compass CodePen
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.
1 | body { |
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:
1 | $base: red; |
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.
1 | @include background-image(linear-gradient($base-light, $base-dark)); |
Video
CodePen
Browse by category:
- apple1
- bash1
- browser1
- case study4
- chrome2
- chrome dev tools4
- clojure overtone2
- conference2
- css2
- dev tips1
- digihike1
- dotfiles2
- event4
- ffconf1
- freelance6
- gaming2
- health3
- hexo1
- https1
- jank1
- javascript1
- jobs1
- lego1
- mcrfred107
- nux1
- octopress4
- photography2
- raspberry pi1
- responsive web design1
- sass1
- screencast1
- speaking2
- svg4
- unplugged6
- upfrontconf1
- web development2
- webgl1
- wordpress17
- work51
- workflow16