Skip to content

Instantly share code, notes, and snippets.

View soderalohastrom's full-sized avatar

Scott Soderstrom soderalohastrom

View GitHub Profile
@soderalohastrom
soderalohastrom / index.html
Last active August 29, 2015 14:03 — forked from anonymous/Demo-Flexbox-1.markdown
Flexbox for Locations page
<div class="block1">
<ul class="flex-container">
<li class="flex-item">1</li>
<li class="flex-item">2</li>
<li class="flex-item">3</li>
<li class="flex-item">4</li>
<li class="flex-item">5</li>
</ul>
</div>
@soderalohastrom
soderalohastrom / generate_responsive_gallery.scss
Created June 22, 2014 01:57
Mixin to change gallery container cell widths
@soderalohastrom
soderalohastrom / li_block_gallery.scss
Created June 22, 2014 01:53
Using list elements with negative margins
@soderalohastrom
soderalohastrom / alt_rowMachine.scss
Created June 22, 2014 01:48
Slightly changed rowMachine
* {
box-sizing: border-box;
}
body {
background: #222;
}
@mixin rowMachine($numPerRow, $margin) {
width: ((100% - (($numPerRow - 1) * $margin)) / $numPerRow);
@soderalohastrom
soderalohastrom / RowMachine.jade
Created June 22, 2014 01:47
Jade for rowMachine (same as repeating 16 divs)
- for (var x = 1; x < 16; x++)
div.person
img(src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/3/darth-vader.jpg")
h3 Darth
@soderalohastrom
soderalohastrom / rowMachine.scss
Created June 22, 2014 01:42
Create a responsive “gallery” of blocks
* {
box-sizing: border-box;
}
body {
background: #222;
}
@mixin rowMachine($numPerRow, $margin) {
width: ((100% - (($numPerRow - 1) * $margin)) / $numPerRow);
@soderalohastrom
soderalohastrom / responsive_breakpoints.scss
Created June 22, 2014 01:26
Simple breakpoint implementation
@mixin breakpoint($point) {
@if $point == large {
@media (min-width: 64.375em) { @content; }
}
@else if $point == medium {
@media (min-width: 50em) { @content; }
}
@else if $point == small {
@media (min-width: 37.5em) { @content; }
}
@soderalohastrom
soderalohastrom / retina_images.scss
Created June 22, 2014 01:24
Include retina scaling for those who have it
@mixin image-2x($image, $width, $height) {
@media (min--moz-device-pixel-ratio: 1.3),
(-o-min-device-pixel-ratio: 2.6/2),
(-webkit-min-device-pixel-ratio: 1.3),
(min-device-pixel-ratio: 1.3),
(min-resolution: 1.3dppx) {
/* on retina, use image that's scaled by 2 */
background-image: url($image);
background-size: $width $height;
}
@soderalohastrom
soderalohastrom / opacity_mixin.scss
Created June 22, 2014 01:23
Opacity mixin with IE fallback
@mixin opacity($opacity) {
opacity: $opacity;
$opacity-ie: $opacity * 100;
filter: alpha(opacity=$opacity-ie); //IE8
}
// Usage:
.article-heading {
@soderalohastrom
soderalohastrom / greyscale_function.scss
Created June 22, 2014 01:19
Grayscale SASS function
@function black($opacity) {
@return rgba(black, $opacity)
}
@function white($opacity) {
@return rgba(white, $opacity)
}