Last active
January 27, 2020 05:18
-
-
Save rizqinizamil/8cf5eb4be94006cd7595 to your computer and use it in GitHub Desktop.
Susy -- Static gutters using calc() https://github.com/ericam/susy/issues/536#issuecomment-153795940
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
// ---- | |
// libsass (v3.2.5) | |
// ---- | |
@import 'susy'; | |
$susy: ( | |
columns: 12, | |
column-width: 5em, | |
); | |
$gutter: gutters(static); | |
@mixin calc-span($span) { | |
$span: append($span, 'wide'); | |
float: left; | |
width: calc(#{span($span)} - #{$gutter}); | |
margin-right: $gutter; | |
} | |
.container { | |
@include container(show); | |
} | |
.test { | |
@include calc-span(3); | |
background: rgba(gray, .5); | |
} | |
.test2 { | |
@include calc-span(4); | |
background: rgba(gray, .5); | |
} |
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
<div class="container"> | |
<div class="test">hello</div> | |
<div class="test2">hello</div> | |
<div class="test">hello</div> | |
</div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment