Skip to content

Instantly share code, notes, and snippets.

@kaseybon
Created January 29, 2014 15:53
Show Gist options
  • Save kaseybon/8690896 to your computer and use it in GitHub Desktop.
Save kaseybon/8690896 to your computer and use it in GitHub Desktop.
@baseFont: 16;
@outer: 50;
@margin: 20;
// Mixins
.inner-box() {
@inner: @outer - @margin;
@innerRem: @inner / @baseFont;
@MarginRem: @margin / @baseFont;
border-radius: ~"@{inner}px";
border-radius: ~"@{innerRem}rem";
margin: 0 ~"@{margin}px";
margin: 0 ~"@{MarginRem}rem";
padding: 0 ~"@{margin}px";
padding: 0 ~"@{MarginRem}rem";
}
.outer-box() {
@outerRem: @outer / @baseFont;
@padding: @margin;
@paddingRem: @margin / @baseFont;
border-radius: ~"@{outer}px";
border-radius: ~"@{outerRem}rem";
padding: ~"@{padding}px" 0;
padding: ~"@{paddingRem}rem" 0;
}
// CSS
.outer {
.outer-box();
}
.inner {
.inner-box();
}
<section class="outer container">
<aside class="inner container">
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus at odio faucibus, venenatis quam vel, dapibus massa. Quisque bibendum in ante in ultrices. Phasellus viverra egestas sapien, in euismod elit auctor eget. Vivamus vitae justo tellus. Morbi fermentum pretium tortor non euismod.</p>
</aside>
</section>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment