Skip to content

Instantly share code, notes, and snippets.

@jeremydouglas
jeremydouglas / fluid-type.scss
Created September 16, 2019 12:46
Fluid Type
@function strip-unit($value) {
@return $value / ($value * 0 + 1);
}
@mixin fluid-type($min-vw, $max-vw, $min-font-size, $max-font-size) {
$u1: unit($min-vw);
$u2: unit($max-vw);
$u3: unit($min-font-size);
$u4: unit($max-font-size);
@jeremydouglas
jeremydouglas / nav.html
Last active September 4, 2019 20:00
Vanilla JS hamburger nav with Tailwindcss classes
<nav aria-label="Main Navigation" class="
js-main-nav
bg-black
pt-30
absolute
inset-0
align-baseline
justify-between
order-3
uppercase
@jeremydouglas
jeremydouglas / 404.html
Created April 18, 2018 15:03
Statamic error page, falling back to clear cache
<div class="container">
<h1>Uh oh</h1>
<hr/>
<p>Something went wrong.</p>
<p>
<a href="/!/Refresh/trigger" class="btn btn-lg btn-success">Try again</a>
</p>
</div>
@jeremydouglas
jeremydouglas / gist:6e62f4d55ed79cd0f3f2
Last active August 29, 2015 14:15
FFMPEg convert video to mp4
ffmpeg -i movie.mov -vcodec libx264 -pix_fmt yuv420p -profile:v baseline -preset slower -crf 18 -vf "scale=trunc(in_w/2)*2:trunc(in_h/2)*2" output.mp4
@jeremydouglas
jeremydouglas / hamburger_menu
Created March 31, 2014 17:39
Hamburger Menu
ul
{
display: none;
}
input[type=checkbox]
{
position: absolute;
top: -9999px;
left: -9999px;
@jeremydouglas
jeremydouglas / SVG Replacement
Last active August 29, 2015 13:57
SVG Replacement
// Automatically replace SVG images on non-supporting browsers
if (!Modernizr.svg || !Modernizr.inlinesvg)
{
$('img.svg').each(function()
{
this.src = this.src.replace('.svg', '.png');
$(this).addClass('svg_loaded');
});
}
@jeremydouglas
jeremydouglas / image.scss
Last active August 29, 2015 13:56
Responsive image
.image_wrap
{
position: relative;
padding-top: 100%;
overflow: hidden;
&--16_9
{
padding-top: 56.25%;
}
@jeremydouglas
jeremydouglas / _columns
Last active August 29, 2015 13:55
Horizontal align columns with text-align: justify
ul
{
text-align: justify;
&:after
{
content: '';
width: 100%; // Ensures there are at least 2 lines of text, so justification works
display: inline-block;
}
@jeremydouglas
jeremydouglas / Vertical Align
Created January 14, 2014 14:56
Vertical Align
%vertical-align {
position: relative;
top: 50%;
-webkit-transform: translateY(-50%);
-moz-transform: translateY(-50%);
-o-transform: translateY(-50%);
-ms-transform: translateY(-50%);
transform: translateY(-50%);
}
@jeremydouglas
jeremydouglas / preferences.json
Last active January 2, 2016 02:49
Emmet Preference file. For coda file is located in ~/Library/Application Support/Coda 2/Plug-ins/Emmet_preferences
{
"css.autoInsertVendorPrefixes": false,
"bem.modifierSeparator": "--",
"bem.shortElementPrefix": "--"
}