Skip to content

Instantly share code, notes, and snippets.

View mattdrose's full-sized avatar

Matt Rose mattdrose

View GitHub Profile
@mattdrose
mattdrose / _contrast-luma.scss
Last active March 8, 2022 14:16
Use SASS to get the contrast color based on a color's luma value (the Y in YIQ). http://en.wikipedia.org/wiki/YIQ This calculates a color that is much more readable. Read more from the W3C. http://www.w3.org/TR/AERT#color-contrast
/*
* Calculate Luma
*
* Luma measures a colors percieved brightness
* by the human eye.
* http://en.wikipedia.org/wiki/YIQ
*/
@function luma($color){
@mattdrose
mattdrose / SassMeister-input.scss
Created September 29, 2014 22:57
Generated by SassMeister.com.
// ----
// Sass (v3.4.4)
// Compass (v1.0.1)
// ----
@mixin module($namespace) {
.#{$namespace},
[class^="#{$namespace}--"],
[class*=" #{$namespace}--"] {
@content;
@mattdrose
mattdrose / SassMeister-input.scss
Created September 29, 2014 22:59
Generated by SassMeister.com.
// ----
// Sass (v3.4.4)
// Compass (v1.0.1)
// ----
@mixin module($namespace) {
.#{$namespace},
[class^="#{$namespace}--"],
[class*=" #{$namespace}--"] {
@content;
@mattdrose
mattdrose / SassMeister-input.scss
Last active August 29, 2015 14:07
Generated by SassMeister.com.
// ----
// Sass (v3.4.4)
// Compass (v1.0.1)
// ----
// Shortcuts
@function get($map, $key) {
@return map-get($map, $key);
}
@mattdrose
mattdrose / SassMeister-input.scss
Created October 3, 2014 21:01
Generated by SassMeister.com.
// ----
// Sass (v3.4.4)
// Compass (v1.0.1)
// ----
// Shortcuts
@function get($map, $key) {
@return map-get($map, $key);
}
@function merge($map-1, $map-2) {
@mattdrose
mattdrose / SassMeister-input.scss
Created October 3, 2014 23:38
Generated by SassMeister.com.
// ----
// Sass (v3.4.4)
// Compass (v1.0.1)
// ----
/**
********************************
* _COLORS.SCSS
********************************
*/
@mattdrose
mattdrose / SassMeister-input.scss
Created October 3, 2014 23:47
Generated by SassMeister.com.
// ----
// Sass (v3.4.4)
// Compass (v1.0.1)
// ----
$color: ();
@mixin addColor($name, $value, $helper: false) {
// Add color to $color map
$color: map-merge($color, ($name: $value)) !global;
@mattdrose
mattdrose / SassMeister-input.scss
Last active August 29, 2015 14:07
Generated by SassMeister.com.
// ----
// Sass (v3.4.5)
// Compass (v1.0.1)
// ----
$gemini-spacing: (
type: (
"push": "margin",
"pad": "padding"
),
@mattdrose
mattdrose / SassMeister-input.scss
Created October 15, 2014 21:08
Generated by SassMeister.com.
// ----
// Sass (v3.4.5)
// Compass (v1.0.1)
// ----
@function map-deep-merge($map1, $map2) {
$return: $map1;
@each $key, $value in $map2 {
@mattdrose
mattdrose / SassMeister-input.scss
Last active August 29, 2015 14:07
Generated by SassMeister.com.
// ----
// Sass (v3.4.5)
// Compass (v1.0.1)
// ----
@function get($key, $map: null) {
@if $map == null {
$map: $default-settings;
}