Skip to content

Instantly share code, notes, and snippets.

@ryanjames
ryanjames / grid-output.css
Created April 19, 2017 03:37
DG grid output
/* line 5, /Users/ryanjames/Sites/desiring-god/app/assets/stylesheets/modules/_grid.scss */
.grid-container {
padding-left: 10px;
padding-right: 10px;
max-width: 400px;
margin-left: auto;
margin-right: auto;
}
/* line 12, /Users/ryanjames/.rvm/gems/ruby-2.4.1/gems/susy-2.2.12/sass/susy/output/support/_clearfix.scss */
.grid-container:after {
@ryanjames
ryanjames / bev.scss
Last active March 10, 2016 06:33
BEV Selector Parsing
// BEVM Selector Processing
// Quick string replace function
@function str-replace($string, $search, $replace: '') {
$index: str-index($string, $search);
@if $index {
@return str-slice($string, 1, $index - 1) + $replace + str-replace(str-slice($string, $index + str-length($search)), $search, $replace);
}
@return $string;
@ryanjames
ryanjames / image-pull.scss
Last active August 29, 2015 14:10
Pull an image outside of a grid container and to the edge of the browser using calc()
/*
Pull an image outside of a grid container and to the edge of the browser
while maintaining its left or right edge position on the grid.
Requires a calc() polyfill for unsupported browsers.
Recommended polyfill: https://github.com/closingtag/calc-polyfill
Current browser support: http://caniuse.com/#feat=calc
*/
@ryanjames
ryanjames / css_boilerplate.scss
Last active August 29, 2015 14:07
Some nice boilerplate CSS
@media screen and (max-device-width: 480px) {
html {
-webkit-text-size-adjust: 100%;
-ms-text-size-adjust: 100%
}
}
*, *:before, *:after { box-sizing: border-box }
body {
@ryanjames
ryanjames / vertical-rhythm.scss
Last active August 29, 2015 14:05
Vertical rhythm mixin
// Throw a font size into this mixin and get optimal line heights and top/bottom margins.
// Adjustable variables to fine-tune.
@mixin vertical-rhythm($size) {
$st: 12px; // Smallest text size
$sh: 140%; // Optimal line height for smallest text size
$lt: 70px; // Largest text size
$lh: 100%; // Optimal line height for largest text size