Created
February 16, 2016 11:53
-
-
Save timschoch/f39290ae7042a9e2eb44 to your computer and use it in GitHub Desktop.
Generated by SassMeister.com.
This file contains 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="foo"> | |
<input /> | |
<button>Search</button> | |
</div> | |
<div class="bar"> | |
<input /> | |
<button>Search</button> | |
</div> |
This file contains 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
// ---- | |
// libsass (v3.2.5) | |
// ---- | |
// the searchbox object (or map) | |
$searchBox: ( | |
border: 1px solid red, | |
width: 400px | |
); | |
// the corresponding searchBox mixin. | |
@mixin searchBox($options: $searchBox) { | |
$options: map-merge( $searchBox, $options); | |
display: flex; | |
border: map-get($options, border); | |
margin-bottom: 30px; | |
padding: 10px; | |
width: map-get($options, width); | |
// obviously the html must be the same for all instancse | |
input { | |
flex: 1; | |
} | |
button { | |
width: 80px; | |
} | |
} | |
// applying OOSCSS | |
.foo { | |
@include searchBox; | |
} | |
.bar { | |
@include searchBox(( | |
width:300px, | |
border: 5px solid green | |
)); | |
} |
This file contains 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
.foo { | |
display: flex; | |
border: 1px solid red; | |
margin-bottom: 30px; | |
padding: 10px; | |
width: 400px; | |
} | |
.foo input { | |
flex: 1; | |
} | |
.foo button { | |
width: 80px; | |
} | |
.bar { | |
display: flex; | |
border: 5px solid green; | |
margin-bottom: 30px; | |
padding: 10px; | |
width: 300px; | |
} | |
.bar input { | |
flex: 1; | |
} | |
.bar button { | |
width: 80px; | |
} |
This file contains 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="foo"> | |
<input /> | |
<button>Search</button> | |
</div> | |
<div class="bar"> | |
<input /> | |
<button>Search</button> | |
</div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment