From d139da3a3277f73d7f01e4283d8dc01630a5317c Mon Sep 17 00:00:00 2001 From: Zhiming Wang Date: Mon, 20 Oct 2014 16:38:24 -0700 Subject: initial setup --- sass/base/_utilities.scss | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 sass/base/_utilities.scss (limited to 'sass/base/_utilities.scss') diff --git a/sass/base/_utilities.scss b/sass/base/_utilities.scss new file mode 100644 index 00000000..2d49e659 --- /dev/null +++ b/sass/base/_utilities.scss @@ -0,0 +1,28 @@ +@mixin mask-image($img, $repeat: no-repeat){ + @include experimental(mask-image, image-url($img), -webkit, -moz, -o, -ms); + @include experimental(mask-repeat, $repeat, -webkit, -moz, -o, -ms); + width: image-width($img); + height: image-height($img); +} + +@mixin shadow-box($border: #fff .5em solid, $shadow: rgba(#000, .15) 0 1px 4px, $border-radius: .3em) { + @include border-radius($border-radius); + @include box-shadow($shadow); + @include box-sizing(border-box); + border: $border; +} + +@mixin selection($bg, $color: inherit, $text-shadow: none){ + * { + &::-moz-selection { background: $bg; color: $color; text-shadow: $text-shadow; } + &::-webkit-selection { background: $bg; color: $color; text-shadow: $text-shadow; } + &::selection { background: $bg; color: $color; text-shadow: $text-shadow; } + } +} + +@function text-color($color, $dark: dark, $light: light){ + $text-color: ( (red($color)*299) + (green($color)*587) + (blue($color)*114) ) / 1000; + $text-color: if($text-color >= 150, $dark, $light); + @return $text-color; +} + -- cgit v1.2.1