Skip to content

Instantly share code, notes, and snippets.

@jhilden
Created May 24, 2014 12:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jhilden/8b9ced0d47e3f3af1582 to your computer and use it in GitHub Desktop.
Save jhilden/8b9ced0d47e3f3af1582 to your computer and use it in GitHub Desktop.
Generated by SassMeister.com.
<div class="m-box b-button-box">
<h3 class="m-box--header">button box</h3>
<div class="m-box--body">
<a class="m-button b-button-box--button">Button</a>
<a class="m-button as-small b-button-box--button">Small button</a>
<a class="m-button b-button-box--button">
<i class="m-button--icon">€</i>
Button with icon
</a>
</div>
</div>
<div class="b-button-box2">
<h3 class="m-box--header">button box 2</h3>
<div class="m-box--body">
<a class="b-button-box2--button">Button</a>
<a class="as-small b-button-box2--button">Small button</a>
<a class="b-button-box2--button">
<i class="m-button--icon">€</i>
Button with icon
</a>
</div>
</div>
// ----
// Sass (v3.3.7)
// Compass (v1.0.0.alpha.18)
// ----
// ---- button ----
// module
.m-button
background-color: orange
border-radius: 5px
padding: 5px 10px
text-decoration: none
display: inline-block
cursor: pointer
// modifier
&.as-small
font-size: 80%
padding: 2px 5px
// sub component
.m-button--icon
background-color: white
border-radius: 100%
width: 1em
display: inline-block
text-align: center
// ---- box ----
// module
.m-box
border: 1px solid black
margin-bottom: 20px
// sub component
.m-box--header
font-weight: bold
text-decoration: underline
padding: 0px 10px
background-color: #ccc
margin: 0
padding: 10px
// sub component
.m-box--body
padding: 10px
// -- button box block --
.b-button-box
border-color: red
.b-button-box--button
margin-right: 20px
// ---- alternative method ----
%m-button
background-color: orange
border-radius: 5px
padding: 5px 10px
text-decoration: none
display: inline-block
cursor: pointer
// modifier
&.as-small
font-size: 80%
padding: 2px 5px
.m-button2
@extend %m-button
%m-box
border: 1px solid black
margin-bottom: 20px
.m-box2
@extend %m-box
.b-button-box2
@extend %m-box
border-color: red
.b-button-box2--button
@extend %m-button
margin-right: 20px
.m-button {
background-color: orange;
border-radius: 5px;
padding: 5px 10px;
text-decoration: none;
display: inline-block;
cursor: pointer;
}
.m-button.as-small {
font-size: 80%;
padding: 2px 5px;
}
.m-button--icon {
background-color: white;
border-radius: 100%;
width: 1em;
display: inline-block;
text-align: center;
}
.m-box {
border: 1px solid black;
margin-bottom: 20px;
}
.m-box--header {
font-weight: bold;
text-decoration: underline;
padding: 0px 10px;
background-color: #cccccc;
margin: 0;
padding: 10px;
}
.m-box--body {
padding: 10px;
}
.b-button-box {
border-color: red;
}
.b-button-box--button {
margin-right: 20px;
}
.m-button2, .b-button-box2--button {
background-color: orange;
border-radius: 5px;
padding: 5px 10px;
text-decoration: none;
display: inline-block;
cursor: pointer;
}
.as-small.m-button2, .as-small.b-button-box2--button {
font-size: 80%;
padding: 2px 5px;
}
.m-box2, .b-button-box2 {
border: 1px solid black;
margin-bottom: 20px;
}
.b-button-box2 {
border-color: red;
}
.b-button-box2--button {
margin-right: 20px;
}
<div class="m-box b-button-box">
<h3 class="m-box--header">button box</h3>
<div class="m-box--body">
<a class="m-button b-button-box--button">Button</a>
<a class="m-button as-small b-button-box--button">Small button</a>
<a class="m-button b-button-box--button">
<i class="m-button--icon">€</i>
Button with icon
</a>
</div>
</div>
<div class="b-button-box2">
<h3 class="m-box--header">button box 2</h3>
<div class="m-box--body">
<a class="b-button-box2--button">Button</a>
<a class="as-small b-button-box2--button">Small button</a>
<a class="b-button-box2--button">
<i class="m-button--icon">€</i>
Button with icon
</a>
</div>
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment