HTML 5 Boilerplate and Compass
Hey there, at #McrFRED someone asked if I used, Sass, LESS, Compass and how I use them.
So, here's how :sunglasses:.
For this demo I'll be using H5BP.
So go ahead and grab a copy by opening up Terminal and running:
1 | git clone [email protected]:h5bp/html5-boilerplate.git |
Or download it as a zip from H5BP if you prefer.
Open up Terminal, go to the directory and run:
1 | gem install compass |
In the root directory, create a config.rb
file, open it, add the following and save:
1 | http_path = "/" |
In your css
folder, change main.css
to main.scss
.
Open main.scss
and add:
1 | @import "compass"; |
Now you can start using Compass.
So for example, rather than writing out:
1 | #radial-gradient { |
In your .scss
file, you can write:
1 | #radial-gradient { |
Back to Terminal, run:
1 | compass watch |
Compass will now be watching for any changes and compile the CSS.
There's loads of awesomoneness going on with Compass.
Here's the gradient example http://compass-style.org/examples/compass/css3/gradient/ and there's loads more here http://compass-style.org/reference/compass/.
And… it's awesome, so yeah, it's on GitHub https://github.com/chriseppstein/compass.
Next post I'll talk about how to debug and Source Maps with Chrome Dev Tools.
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