Christopher Bloom
Frontend developer, lover of design systems, CSS architecture, and all things javascript.
Unit 7, Week 8
Compass, Zurb Foundation
cd /directory/to/wdim351-curriculum
git status
git add -A .
git commit -m "committing local changes" # run the following only if you have not set your upstream to my repo
git remote add upstream "git@github.com:aipdx-wdim351/wdim351-curriculum.git" git pull upstream master
Generates a full, combined sprite sheet. Writes CSS that refers to the exact position (background x-y) of the sprite. Includes height/width of sprite as wel..
Pull upstream wdim351-curriculum to follow along. Sprites courtesy of http://simpleicons.org/.
relative_assets = config
Lots of "syntactic sugar". Based on folder name inside "images" folder:
<project>
- images
- - oursprites
- - - sprite1.png
- - - sprite2.png
- - - sprite3.png
Activated by:
@import "oursprites/*.png";
// SCSS a[href*="facebook"]{ @include oursprites-sprite("facebook-64"); background-color: #3B5998; }
// CSS a[href*="facebook"] { background-position: 0 -768px; height: 64px; width: 64px; background-color: #3B5998; } a[href*="facebook"]:hover, a[href*="facebook"].facebook-64_hover, a[href*="facebook"].facebook-64-hover { background-position: 0 -320px; }
Hover?!
// SCSS .sprite-dimensions{ width: oursprites-sprite-width("facebook-64"); height: oursprites-sprite-height("facebook-64"); background: grey; }
"New" hide text function:
// SCSS @include hide-text();
// CSS text-indent: -119988px; overflow: hidden; text-align: left;
[sudo] gem install foundation
Start a new Foundation project:
foundation new foundation-inclass
<project>/bower_components/foundation/scss/foundation
Package management. Every project is a collection of other projects. Don't bloat your code by including all those other projects wholesale. Instead, include a file that simply points at other projects to be included when starting.
<div class="row">
<div class="small-2 large-4 columns">...</div>
<div class="small-4 large-4 columns">...</div>
<div class="small-6 large-4 columns">...</div>
</div>
Check your vars in _settings.scss!
Tools:
By Christopher Bloom
Frontend developer, lover of design systems, CSS architecture, and all things javascript.