Skip to content

Instantly share code, notes, and snippets.

View cocopon's full-sized avatar
🍣

Hiroki Kokubun cocopon

🍣
View GitHub Profile
@cocopon
cocopon / Sass::Script::Functions#ms_filter_rgba
Last active December 21, 2015 17:38
Sass transparent color function for legacy IE (<= 8)
module Sass::Script::Functions
def ms_filter_rgba(*args)
if args.size == 4
red, green, blue, alpha = args
return ms_rgba(rgb(red, green, blue), alpha)
end
if args.size != 2
raise ArgumentError.new("wrong number of arguments (#{args.size} for 2 or 4")
end
@cocopon
cocopon / sass_edge_functions
Last active December 14, 2015 10:49
Sass functions that extract a specified edge
// Example:
//
// $padding: 1px 2px 3px;
// top($padding) ...... 1px
// right($padding) .... 2px
// bottom($padding) ... 3px
// left($padding) ..... 2px
@function top($args) {
$len: length($args);