Skip to content

Instantly share code, notes, and snippets.

Avatar

Fitz Ryland fitzryland

View GitHub Profile
@fitzryland
fitzryland / basicSusyBreakpoints.scss
Last active Aug 29, 2015
My Basic Susy Breakpoint Setup
View basicSusyBreakpoints.scss
// $breakpoint-no-queries: false;
$breakpoint-no-query-fallbacks: true;
$susy: (
gutters: 0.2
);
$layouts: (
small: (
break: 0em 37.5em,
@fitzryland
fitzryland / mapFunctions.scss
Last active Aug 29, 2015
Essential Sass Map Functions
View mapFunctions.scss
@function map($targetMap, $mapList) {
$mapItem: $targetMap;
@each $mapPart in $mapList {
$mapItem: map-get($mapItem, $mapPart);
}
@return $mapItem;
}
@function color($colorTree) {
@return map($color, $colorTree);
}
@fitzryland
fitzryland / Self Clear Mixin'
Created Jun 28, 2013
This is the mixin' I use to make sure elements self clear. It isn't perfect, but is usually just the right thing.
View Self Clear Mixin'
@mixin group() {
&:after {
content: "";
display: table;
clear: both;
}
}
@fitzryland
fitzryland / Returns image from Advanced Custom Fields Image Object
Last active Dec 19, 2015
Put this function in your functions file and pass the image object from ACF, classes you might want to put on the image, and the WordPress image size name. This function will return an image with the proper src, width, height, title. WordPress, Advanced Custom Fields Plugin
View Returns image from Advanced Custom Fields Image Object
<?php
function custom_acf_image_output($aImg, $class, $size) {
if ($size) {
$widthString = $size . "-width";
$heightString = $size . "-height";
$imgStr = "<img src=\"" . $aImg['sizes'][$size] . "\" alt=\"" . $aImg['title'] . "\" width=\"" . $aImg['sizes'][$widthString] . "\" height=\"" . $aImg['sizes'][$heightString] . "\"";
if ($class) {
$imgStr .= " class=\"" . $class . "\"";
}
$imgStr .= ">";
You can’t perform that action at this time.