Created
July 15, 2014 17:46
-
-
Save shayhowe/c48c74d53a327091ddd0 to your computer and use it in GitHub Desktop.
Generated by SassMeister.com.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="container"> | |
<div class="alert alert-error"> | |
<p>Error</p> | |
</div> | |
<div class="alert alert-success"> | |
<p>Success</p> | |
</div> | |
<div class="alert alert-info"> | |
<p>Info</p> | |
</div> | |
<div class="alert alert-warning"> | |
<p>Info</p> | |
</div> | |
</div> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ---- | |
// Sass (v3.3.10) | |
// Compass (v1.0.0.alpha.20) | |
// ---- | |
// Color settings | |
$color-red: #DB4437; | |
$color-green: #a9cf54; | |
$color-blue: #477dca; | |
$color-yellow: #F4B400; | |
$color-white: #ffffff; | |
$color-gray: #aaaaaa; | |
// Error settings | |
$alert-default: $color-gray; | |
$alert-error: $color-red; | |
$alert-success: $color-green; | |
$alert-info: $color-blue; | |
$alert-warning: $color-yellow; | |
// Spacing settings | |
$base-unit: 1em; | |
.container { | |
margin: 0 auto; | |
max-width: 50em; | |
overflow: hidden; | |
} | |
// Alert panel placeholder selector | |
%panel { | |
border-radius: 5px; | |
color: $color-white; | |
margin-bottom: 1em; | |
overflow: hidden; | |
padding: 1em; | |
text-align: center; | |
} | |
// Sets up the alert "sass map" | |
// to add a new alert, just add a new | |
// key value pair to the bottom and update | |
// the markup. | |
$alerts: ( | |
error: $alert-error, | |
success: $alert-success, | |
info: $alert-info, | |
warning: $alert-warning | |
); | |
// Loops through the sass map keys/values | |
// and compiles the proper CSS | |
@each $alert, $bgcolor in $alerts { | |
.alert-#{$alert} { | |
@extend %panel; | |
background: $bgcolor; | |
border: 1px solid darken($bgcolor, 20%); | |
} | |
.alert-#{$alert}:hover { | |
background: lighten($bgcolor, 10%); | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.container { | |
margin: 0 auto; | |
max-width: 50em; | |
overflow: hidden; | |
} | |
.alert-error, .alert-success, .alert-info, .alert-warning { | |
border-radius: 5px; | |
color: white; | |
margin-bottom: 1em; | |
overflow: hidden; | |
padding: 1em; | |
text-align: center; | |
} | |
.alert-error { | |
background: #db4437; | |
border: 1px solid #92241a; | |
} | |
.alert-error:hover { | |
background: #e36c62; | |
} | |
.alert-success { | |
background: #a9cf54; | |
border: 1px solid #739429; | |
} | |
.alert-success:hover { | |
background: #bdda7c; | |
} | |
.alert-info { | |
background: #477dca; | |
border: 1px solid #264d85; | |
} | |
.alert-info:hover { | |
background: #6f99d5; | |
} | |
.alert-warning { | |
background: #f4b400; | |
border: 1px solid #8e6900; | |
} | |
.alert-warning:hover { | |
background: #ffc728; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="container"> | |
<div class="alert alert-error"> | |
<p>Error</p> | |
</div> | |
<div class="alert alert-success"> | |
<p>Success</p> | |
</div> | |
<div class="alert alert-info"> | |
<p>Info</p> | |
</div> | |
<div class="alert alert-warning"> | |
<p>Info</p> | |
</div> | |
</div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment