Skip to content

Instantly share code, notes, and snippets.

View magicspon's full-sized avatar
🤘

Dave Stockley magicspon

🤘
View GitHub Profile
@magicspon
magicspon / SassMeister-input.scss
Last active August 25, 2015 21:30
Generated by SassMeister.com.
@mixin side__panel($b: side, $e: panel, $m: alert) {
$selector: $b;
@if $e != false {
$selector: #{$selector}__#{$e};
}
@if $m != false {
$selector: #{$selector}--#{$m};
}
.#{$selector} {
@magicspon
magicspon / map-extend.scss
Last active August 29, 2015 14:08
Generated by SassMeister.com.
// ----
// Sass (v3.4.7)
// Compass (v1.0.1)
// ----
// thanks to @ericmsuzanne for this function
@function map-set($map, $key, $value) {
$new: ($key: $value);
@return map-merge($map, $new);
}
@magicspon
magicspon / font-size-input.scss
Last active August 29, 2015 14:10
Generated by SassMeister.com.
$base-font-size: 16px;
$base-line-height: 24px;
@function computeLineHeight($font-size, $computed) {
$fs: strip-units($font-size);
@return $computed / $fs;
}
@function strip-units($value) {
@magicspon
magicspon / SassMeister-input.scss
Created November 21, 2014 15:40
Generated by SassMeister.com.
// ----
// libsass (v3.0.1)
// ----
@function sprite-spacing($sprite, $property: width, $excess: 0) {
$ext: if($property == width, 5, 6);
// 5 == width
// 6 == height
$spacing: nth($sprite, 5);
@magicspon
magicspon / SassMeister-input.scss
Last active August 29, 2015 14:10
Pointless SCSS Number 1
// totally pointless mixin..
// save yourself from typing two characters
// when applying the same values to different properties
// think of all the things you can do with the time saved
// @include s((border-left,border-right), 1px solid red); == 54 chars
// border-left: 1px solid red; border-right: 1px solid red; == 56 chars
// that's right... totally pointless mixin
@mixin s($props: (s, i, a, l), $val: false){
@for $i from 1 through length($props) {
$prop: nth($props, $i);
@magicspon
magicspon / gist:b3467bdc08543f199bdf
Created January 7, 2015 09:23
Masonry/imagesLoaded setup
// init Masonry var
var msnry;
// containing wrapper
var container = $('.wrapper');
// the element to be masonaryified
var el = $('.box');
// pass as a callback into the imagesLoaded function
imagesLoaded(container, function() {
@magicspon
magicspon / _tools-grid.scss
Created January 7, 2015 12:52
Gridset helper functions/mixins
// return the column width minus gutter
@function gs-width-no-marin($grid, $start, $end: false, $container: false, $unit: false) {
$output: gs-width($grid,$start,$end, $unit: false) + (gs-gutter($grid, $container: false, $unit:false) /2);
@if $unit = true {
$output: $output * 1%;
}
@return $output;
@magicspon
magicspon / gist:b581c7bb9bd1f72a0df7
Created January 30, 2015 10:16
example paper svg output
<svg x="0" y="0" width="1268.5625" height="1030" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><g fill="none" stroke="#000000" stroke-width="10" stroke-linecap="butt" stroke-linejoin="miter" stroke-miterlimit="10" stroke-dasharray="" stroke-dashoffset="0" font-family="sans-serif" font-weight="normal" font-size="12" text-anchor="start" mix-blend-mode="normal"><path d="M277,309c0.16722,0.23169 0.33443,0.46338 0,-1c-0.33443,-1.46338 -1.17051,-4.62183 -1,-12c0.17051,-7.37817 1.34761,-18.97606 5,-29c3.65239,-10.02394 9.78008,-18.47395 18,-28c8.21992,-9.52605 18.53206,-20.12816 52,-38c33.46794,-17.87184 90.09168,-43.01341 121,-55c30.90832,-11.98659 36.10124,-10.81822 44,-11c7.89876,-0.18178 18.50337,-1.71373 30,-1c11.49663,0.71373 23.88528,3.67312 33,7c9.11472,3.32688 14.95552,7.02124 22,12c7.04448,4.97876 15.29265,11.24193 21,19c5.70735,7.75807 8.87387,17.01103 11,24c2.12613,6.98897 3.21187,11.71393 4,19c0.78813,7.28607 1.27865,17.13325 -1,27c-2.27865,9.86675 -7.32648,
@magicspon
magicspon / SassMeister-input-HTML.html
Created March 19, 2015 17:47
Generated by SassMeister.com.
<div class="test"></div>
@magicspon
magicspon / SassMeister-input-HTML.html
Created March 19, 2015 22:46
Generated by SassMeister.com.
<div class="b"></div>