Skip to content

Instantly share code, notes, and snippets.

@zapatoche
Created November 26, 2014 11:48
Show Gist options
  • Select an option

  • Save zapatoche/958537d4c7a75bed2f65 to your computer and use it in GitHub Desktop.

Select an option

Save zapatoche/958537d4c7a75bed2f65 to your computer and use it in GitHub Desktop.
Generated by SassMeister.com.
.light-body Donec id elit non mi porta gravida at eget metus.
.dark-body Donec id elit non mi porta gravida at eget metus.
.blue-body Donec id elit non mi porta gravida at eget metus.
// ----
// Sass (v3.4.7)
// Compass (v1.0.1)
// ----
$orange: #F36B21;
$blue: #383B52;
$background-dark: #222;
$background-light: #fff;
@mixin rgba-fallback($property, $color, $opacity, $background: light) {
$background-color: $background-light;
@if $background == dark {
$background-color: $background-dark;
} @elseif type-of($background) == color {
$background-color: $background;
}
#{$property}: mix($color, $background-color, ($opacity*100%));
#{$property}: rgba($color, $opacity);
}
div {
margin: 1em;
padding: 1em;
width: 10em;
border: 1px solid $orange;
float: left;
}
.light-body {
background: $background-light;
@include rgba-fallback(color, $orange, .75);
}
.dark-body {
background: $background-dark;
@include rgba-fallback(color, $orange, .75, dark);
}
.blue-body {
background: $blue;
@include rgba-fallback(color, $orange, .75, $blue);
}
div {
margin: 1em;
padding: 1em;
width: 10em;
border: 1px solid #F36B21;
float: left;
}
.light-body {
background: #fff;
color: #f69058;
color: rgba(243, 107, 33, 0.75);
}
.dark-body {
background: #222;
color: #be5821;
color: rgba(243, 107, 33, 0.75);
}
.blue-body {
background: #383B52;
color: #c45f2d;
color: rgba(243, 107, 33, 0.75);
}
<div class='light-body'>Donec id elit non mi porta gravida at eget metus.</div>
<div class='dark-body'>Donec id elit non mi porta gravida at eget metus.</div>
<div class='blue-body'>Donec id elit non mi porta gravida at eget metus.</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment