Skip to content

Instantly share code, notes, and snippets.

@machida
Created January 28, 2014 08:31
Show Gist options
  • Save machida/8664007 to your computer and use it in GitHub Desktop.
Save machida/8664007 to your computer and use it in GitHub Desktop.
rgbaをIE8に対応させるためのmixin
=rgba($foreground, $backdrop: white, $property: "background-color")
#{$property}: mix(fade-in($foreground, 1), $backdrop, percentage(opacity($foreground)))
// Browsers without color opacity
#{$property}: $foreground
// Decent browsers
@if $property == "background-color"
.lt-ie9 &
// IE8 has background filters; use them instead
#{$property}: transparent
$ie-hex: ie-hex-str($foreground)
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#{$ie-hex},endColorstr=#{$ie-hex})
zoom: 1
@machida
Copy link
Author

machida commented Jan 28, 2014

+rgba(rgba(0, 0, 0, .7))

+rgba(rgba(0, 0, 0, .7), white, border-bottom-color)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment