Skip to content

Instantly share code, notes, and snippets.

.ico-flag-australia:before {
background-position: 0px top;
}
.ico-flag-brazil:before {
background-position: -16px top;
}
.ico-flag-canada:before {
background-position: -32px top;
@for $i from 1 through length($countries) {
$country: nth($countries, $i);
.ico-flag-#{$country} {
@include flag-sprite($i);
}
}
@mixin flag-sprite($offset) {
$offset: $offset - 1;
&:before {
background-position: 16px*-$offset top;
}
}
@for $i from 1 through length($countries) {
$country: nth($countries, $i);
.ico-flag-#{$country} {
}
}
@each $country in $countries {
//do something with $country
}
$countries: australia brazil canada chile costa_rica croatia greece india iran italy mauritania poland russia rwanda south_africa spain united_states zimbabwe;
#!/bin/bash
cd folder/with/icons
for string in `ls`
do
echo ${string%%.*} | tr '[:upper:]' '[:lower:]' | sed 's/-/_'
done
.ico-flag {
position: relative;
height: 11px;
&:before {
content: "";
position: absolute;
width: 14px;
height: 11px;
top: 50%;
left: 0;
@tessalt
tessalt / gruntfile.js
Created August 29, 2013 17:07
Gruntfile for use with #yeoman #jade
// Generated on 2013-08-28 using generator-webapp 0.4.1
'use strict';
var LIVERELOAD_PORT = 35729;
var lrSnippet = require('connect-livereload')({port: LIVERELOAD_PORT});
var mountFolder = function (connect, dir) {
return connect.static(require('path').resolve(dir));
};
// # Globbing
// for performance reasons we're only matching one level down:

Using Yeoman and Jade

Getting started

  • Make sure you have yo installed: npm install -g yo
  • Run: yo webapp
  • Install grunt-contrib-jade: npm install grunt-contrib-jade --save-dev

Customization