Guest User

Untitled

a guest
May 22nd, 2018
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.84 KB | None | 0 0
  1. position(
  2. - justification [left, h-center, right], // - could delimit optional, + could delimit required
  3. - alignment [top, v-center, bottom]
  4. ) {
  5. // map enum to expressions
  6. :: [left, top] flex-start
  7. :: [h-center, v-center] center
  8. :: [right, bottom] flex-end
  9.  
  10. // no colons or semicolons
  11. display flex
  12. [justify-content justification] // [] delimits optional
  13. [align-items alignment]
  14. }
  15.  
  16. left() { position(left) } // () distinguishes function from element
  17. h-center() { position(h-center) }
  18. right() { position(right) }
  19. top() { position(top) }
  20. v-center() { position(v-center) }
  21. bottom() { position(bottom) }
  22.  
  23. center() {
  24. h-center // () unneeded if no arguments
  25. v-center
  26. }
  27.  
  28. .h1 {
  29. headline
  30. center
  31. highlight
  32. }
  33.  
  34. .h2 {
  35. headline
  36. center
  37. highlight--alternate // BEM identifiers!
  38. }
Add Comment
Please, Sign In to add comment