Skip to content

Instantly share code, notes, and snippets.

View stormwarning's full-sized avatar
👀

Jeff stormwarning

👀
View GitHub Profile
@stormwarning
stormwarning / mixin--font-specimen.scss
Last active December 14, 2015 10:39
Opinionated @font-face SASS mixin for embedding with better style and weight control.
/**
* Embed @font-face with better style and weight control.
*
@include font-specimen(OpenSans, normal, 300);
@include font-specimen(OpenSans, normal, 400);
@include font-specimen(OpenSans, italic, 600);
*
* Depends on a specific filename scheme; edit the `url` paths to match your setup.
*
*/
// Colours
$turquoise: #1abc9c;
$green-sea: #16a085;
$emerland: #2ecc71;
$nephritis: #27ae60;
$peter-river: #3498db;
$belize-hole: #2980b9;
$amethyst: #9b59b6;
$wisteria: #8e44ad;
@stormwarning
stormwarning / font-weight.scss
Last active December 18, 2015 01:49
Attempting to map common typographic weight terminology to CSS/TrueType/OpenType values;
$hairline: 100;
$thin: 200; // aka Extra light, Ultra light
$light: 300;
$normal: 400; // aka Book, Roman
$medium: 500;
$semibold: 600; // aka Demi-bold
$bold: 700;
$extrabold: 800; // aka Ultra bold
$black: 900; // aka Heavy
@stormwarning
stormwarning / mixin--rem.scss
Last active December 18, 2015 05:09
Rem units with px fallback
/**
* Output a selector with px fallback and rem values, so that modern browsers will use the rem values.
* Both multiple selectors and multiple sizes in multiple units can be provided.
* Zero values remain 0, non-px values will not be modified.
*
* Usage example:
*
.navbar {
@include rem(height line-height, 48px); // multiple selectors
@include rem(padding, 16px 8px 2% 0px); // multiple units, only px will be converted
@stormwarning
stormwarning / .editorconfig
Created July 10, 2013 20:42
An editorconfig file for idiomatic HTML/CSS.
# editorconfig.org
root = true
[*]
indent_style = space
indent_size = 4
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
@stormwarning
stormwarning / code-tricks-the-pros-use.txt
Last active December 27, 2015 16:48
code-tricks-the-pros-use.txt
Learn to code like a pro.
// vendor prefix order
, vendorPrefixes = [
'-webkit-'
, '-khtml-'
, '-epub-'
, '-moz-'
, '-ms-'
, '-o-'
]
@stormwarning
stormwarning / mixin--rgba.scss
Last active December 29, 2015 20:39
Generate a colour value from an RGBa value.
/**
* A very simple, pragmatic Sass mixin for generating any property with an rgba() colour
* and its associated fallback (sourced from the original rgba() colour).
*
* Do not use if you require a fallback vastly different from the rgba().
*
* 1. Strip the alpha value and write out a solid rgb() color.
* 2. Drop the red, green, blue, and alpha paramaters into the relevant places.
*
h1 {
@stormwarning
stormwarning / __wordpress.php
Last active February 29, 2024 03:03
WordPress PROTIPs
/**
* A selection of handy code snippets, plugins, and best practices for WordPress development.
*
*/
@stormwarning
stormwarning / nir.css
Last active January 2, 2016 03:39
CSS image replacement using pseudo-elements.
/**
* Image replacement
*
* 1. Dimensions of replacement image
* 2. Fix for Firefox 2-
* 3. Required for IE8 if no `a:hover` styles declared
*
* Usage:
<a class="nir" href="[url]">[text]</a>
*