Created
March 31, 2015 13:48
-
-
Save DLavin23/79b363da1930695f06a6 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
<link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css"> | |
<div class="hero hero--devry"> | |
<h1>Module</h1> | |
</div> | |
<div class="hero hero--keller"> | |
<h1>Module</h1> | |
</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.4.12) | |
// Compass (v1.0.3) | |
// ---- | |
$devry-colors: ( | |
primary: blue, | |
secondary: white | |
); | |
$keller-colors: ( | |
primary: red, | |
secondary: #f0e9d2 | |
); | |
@mixin component($config: ()) { | |
// Extending the default arguments with the given object | |
$config: map-merge(( | |
'theme': default, | |
'name': 'module', | |
'spacing': 1em, | |
'size': 100%, | |
'border': false | |
), $config); | |
// generating the css | |
.#{map-get($config, name)} { | |
margin-bottom: map-get($config, spacing); | |
padding: map-get($config, spacing); | |
width: map-get($config, size); | |
&--#{map-get($config, theme)} { | |
$theme: map-get($config, theme); | |
@if $theme == "default" { | |
background: #333; | |
color: #FEFEFE; | |
} | |
@if $theme == "devry" { | |
background: map-get($devry-colors, primary); | |
color: map-get($devry-colors, secondary); | |
@if map-get($config, border) == true { | |
border: 3px solid red; | |
} | |
} | |
@if $theme == "keller" { | |
background: map-get($keller-colors, primary); | |
color: map-get($keller-colors, secondary); | |
@if map-get($config, border) == true { | |
border: 3px solid teal; | |
} | |
} | |
} | |
} | |
} | |
@include component(( | |
theme: keller, | |
name: 'hero', | |
border: false | |
)); | |
@include component(( | |
theme: devry, | |
name: 'hero', | |
border: true | |
)); |
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
.hero { | |
margin-bottom: 1em; | |
padding: 1em; | |
width: 100%; | |
} | |
.hero--keller { | |
background: red; | |
color: #f0e9d2; | |
} | |
.hero { | |
margin-bottom: 1em; | |
padding: 1em; | |
width: 100%; | |
} | |
.hero--devry { | |
background: blue; | |
color: white; | |
border: 3px solid red; | |
} |
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
<link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css"> | |
<div class="hero hero--devry"> | |
<h1>Module</h1> | |
</div> | |
<div class="hero hero--keller"> | |
<h1>Module</h1> | |
</div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment