Skip to content

Instantly share code, notes, and snippets.

@jhilden
Created May 24, 2014 12:29
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/734fab1f662c47c02b16 to your computer and use it in GitHub Desktop.
Save jhilden/734fab1f662c47c02b16 to your computer and use it in GitHub Desktop.
Generated by SassMeister.com.
<div class="m-box">
<h3 class="m-box--header">Some buttons</h3>
<div class="m-box--body">
<a class="m-button">Button</a>
<a class="m-button as-small">Small button</a>
<a class="m-button">
<i class="m-button--icon">€</i>
Button with icon
</a>
<a class="m-button is-disabled">
Button disabled
</a>
<a class="m-button as-small is-disabled">
<i class="m-button--icon">€</i>
Small disabled button with icon
</a>
<a class="m-button_secondary">
<i class="m-button--icon">€</i>
Secondary button submodule
</a>
</div>
</div>
<div class="m-box as-highlighted">
<h1 class="m-box--header">Highlighted box</h1>
<p class="m-box--body">Box body: Lorem ipsum text</p>
</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
// state
&.is-disabled
background-color: silver
cursor: default
opacity: .5
// sub component
.m-button--icon
background-color: white
border-radius: 100%
width: 1em
display: inline-block
text-align: center
// sub module
.m-button_secondary
@extend .m-button
background-color: lightblue
text-decoration: line-through
// ---- 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
// modifier that also applies to sub component
.m-box
&.as-highlighted
border-color: green
.m-box--header
background-color: yellow
.m-button, .m-button_secondary {
background-color: orange;
border-radius: 5px;
padding: 5px 10px;
text-decoration: none;
display: inline-block;
cursor: pointer;
}
.m-button.as-small, .as-small.m-button_secondary {
font-size: 80%;
padding: 2px 5px;
}
.m-button.is-disabled, .is-disabled.m-button_secondary {
background-color: silver;
cursor: default;
opacity: 0.5;
}
.m-button--icon {
background-color: white;
border-radius: 100%;
width: 1em;
display: inline-block;
text-align: center;
}
.m-button_secondary {
background-color: lightblue;
text-decoration: line-through;
}
.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;
}
.m-box.as-highlighted {
border-color: green;
}
.m-box.as-highlighted .m-box--header {
background-color: yellow;
}
<div class="m-box">
<h3 class="m-box--header">Some buttons</h3>
<div class="m-box--body">
<a class="m-button">Button</a>
<a class="m-button as-small">Small button</a>
<a class="m-button">
<i class="m-button--icon">€</i>
Button with icon
</a>
<a class="m-button is-disabled">
Button disabled
</a>
<a class="m-button as-small is-disabled">
<i class="m-button--icon">€</i>
Small disabled button with icon
</a>
<a class="m-button_secondary">
<i class="m-button--icon">€</i>
Secondary button submodule
</a>
</div>
</div>
<div class="m-box as-highlighted">
<h1 class="m-box--header">Highlighted box</h1>
<p class="m-box--body">Box body: Lorem ipsum text</p>
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment