Last active
August 29, 2015 14:06
-
-
Save vjandrei/6b9e440be245dbe33e0f to your computer and use it in GitHub Desktop.
Generated by SassMeister.com.
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
// ---- | |
// Esimerkki kuinka käyttää Sass Mixineitä null data tyypillä. | |
// ---- | |
// Luodaan mixin nimeltää display, jossa on haluttuja properteja kuten | |
// Display, Padding, Margin-Left, Margin-Right. Jotta halutut propertit toimii @includessa | |
// tulee niiden olla data pyytiltään null. Kuten esimerkissä. | |
@mixin display ( | |
$disp, | |
$padding: null, | |
$r-margin: null, | |
$l-margin: null) { | |
display: $disp; | |
padding: $padding; | |
margin-left: $l-margin; | |
margin-right: $r-margin; | |
} | |
.nav__item { | |
@include display(inline-block, $l-margin: 20px); | |
} | |
// Nyt kun mixinissä on määritetty propertyt voidaan ne ketjuttaa @includella kuten esimerkissä | |
.nav__link { | |
@include display(block, 10px, 10px, 10px); | |
} |
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
.nav__item { | |
display: inline-block; | |
margin-left: 20px; | |
} | |
.nav__link { | |
display: block; | |
padding: 10px; | |
margin-left: 10px; | |
margin-right: 10px; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment