Skip to content

Instantly share code, notes, and snippets.

@mwanberg
mwanberg / _fonts.scss
Created September 20, 2016 23:42
Generate @font-face declarations
// Lato
$fonts-path: '../fonts/LatoLatin/fonts';
// List of fonts used
// name_of_font: 'path_of_font'
// Please add only as many as you absolutely need
$font-list: (
LatoLatin-Regular: 'LatoLatin-Regular',
LatoLatin-Bold: 'LatoLatin-Bold'
);
@mwanberg
mwanberg / _font-icons.scss
Last active August 29, 2015 14:26
Font helpers for Sass
//
// Font icons
//
// Demo page: [path to the demo page generated by Fontello]
// Font declaration and default styles copied from
// [path to CSS generated by Fontello] and turned into Sass.
// This path should be relative to the rendered CSS
$project-icons-path: '../fonts/project-icons/font/project-icons';
@mwanberg
mwanberg / SassMeister-input.scss
Last active August 29, 2015 14:01
Generated by SassMeister.com.
// ----
// Sass (v3.3.6)
// Compass (v1.0.0.alpha.18)
// ----
// Create a variable list for the icon names and content attribute
$project-icons-list: "search" "\e603",
"envelope" "\e604",
"star-empty" "\e606",
"ok" "\e605",
@mwanberg
mwanberg / respond-to.scss
Created August 31, 2013 04:53
This Sass mixin lets you target variablized media queries, arbitrary min-width breakpoints, IE versions 7-10, and print. It defaults to applying your media query styles to both IE8 (since that version doesn't recognize media queries) and to print media queries, but you can unset the default behavior using arguments.
//
// Variables assumed by the mixin
//
$print: "print";
$ie10: ".ie10";
$ie9: ".lt-ie10";
$ie8: ".lt-ie9";
$ie7: ".lt-ie8";
@mwanberg
mwanberg / mixin-gridify.scss
Last active December 21, 2015 11:48
Make elements align in a grid, regardless of height. Apply to elements you want as grid items. This assumes divs, but can be applied to anything, assuming the container horizontal margins have been set to 0 and you're using "box-sizing: border-box". $cols = The number of columns you want $margin-right = Margin-right, should be in percent, defaul…
// Make elements align in a grid, regardless of height
// Apply to elements you want as grid items
// $cols = how many columns you want
// $margin-right = margin-right, should be in percent
// $ie8-height = an explicit height for all the elements, "off" by default, only applied to IE
@mixin gridify($cols, $margin-right: 5%, $ie8-height: auto) {
// Math for widths, margins, and clears
$width: (100% / $cols) - $margin-right + ($margin-right / $cols);
$ie-width: (100% / $cols) - $margin-right;
$clearnum: $cols + 1;