Skip to content

Instantly share code, notes, and snippets.

View andi1984's full-sized avatar
🏠
Working from home

Andreas Sander andi1984

🏠
Working from home
View GitHub Profile
@andi1984
andi1984 / surface.css
Created August 27, 2015 07:10
Responsive Microsoft Surface
@-ms-viewport{width:device-width}
#!/usr/bin/sh
rm -rf $HOME/Library/Preferences/WebIde*
rm -rf $HOME/Library/Caches/WebIde*
rm -rf $HOME/Library/Application Support/WebIde*
rm -rf $HOME/Library/Logs/WebIde*
img.grayscale.disabled {
filter: url("data:image/svg+xml;utf8,<svg xmlns=\'http://www.w3.org/2000/svg\'><filter id=\'grayscale\'><feColorMatrix type=\'matrix\' values=\'1 0 0 0 0, 0 1 0 0 0, 0 0 1 0 0, 0 0 0 1 0\'/></filter></svg>#grayscale");
-webkit-filter: grayscale(0%);
}
$base-font-size: 16px;
$base-line-height: 1.5;
// this value may vary for each font
// unitless value relative to 1em
$cap-height: 0.68;
@mixin baseline($font-size, $scale: 2) {
@mixin triangle($direction:up, $hypotenuse-width:20px, $color:black) {
$triangle-border-width: $hypotenuse-width/2;
$triangleSettings: (
up: (
border-left: $triangle-border-width solid transparent,
border-right: $triangle-border-width solid transparent,
border-bottom: $triangle-border-width solid $color,
),
right: (
border-top: $triangle-border-width solid transparent,
// Brightness math based on:
// http://www.nbdtech.com/Blog/archive/2008/04/27/Calculating-the-Perceived-Brightness-of-a-Color.aspx
$red-magic-number: 241;
$green-magic-number: 691;
$blue-magic-number: 68;
$brightness-divisor: $red-magic-number + $green-magic-number + $blue-magic-number;
@function brightness($color) {
// Extract color components
// Add percentage of white to a color
@function tint($color, $percent){
@return mix(white, $color, $percent);
}
// Add percentage of black to a color
@function shade($color, $percent){
@return mix(black, $color, $percent);
}
@andi1984
andi1984 / _color.scss
Last active August 29, 2015 14:02 — forked from anonymous/index.html
@import "compass/css3";
@function relativeLuminance($color) {
@return 0.2126 * red($color)/255.0 +
0.7152 * green($color)/255.0 +
0.0722 * blue($color)/255.0;
}
@function contrast($color1,$color2) {
$luminance1: relativeLuminance($color1);
$luminance2: relativeLuminance($color2);