Last active
June 15, 2018 10:07
-
-
Save zaydek-old/533a8570348fed6c4d0db2a263148b2d to your computer and use it in GitHub Desktop.
This file contains 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
position( | |
- justification [left, h-center, right], // - could delimit optional, + could delimit required | |
- alignment [top, v-center, bottom] | |
) { | |
// map enum to expressions | |
:: [left, top] flex-start | |
:: [h-center, v-center] center | |
:: [right, bottom] flex-end | |
// no colons or semicolons | |
display flex | |
[justify-content justification] // [] delimits optional | |
[align-items alignment] | |
} | |
left() { position(left) } // () distinguishes function from element | |
h-center() { position(h-center) } | |
right() { position(right) } | |
top() { position(top) } | |
v-center() { position(v-center) } | |
bottom() { position(bottom) } | |
center() { | |
h-center // () unneeded if no arguments | |
v-center | |
} | |
.h1 { | |
headline | |
center | |
highlight | |
} | |
.h2 { | |
headline | |
center | |
highlight--alternate // BEM identifiers! | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment