Advertisement
Guest User

Untitled

a guest
Oct 21st, 2019
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.67 KB | None | 0 0
  1. //Get the value for justify-content
  2. @function getJustify($arg){
  3. $justify: (
  4. 'sa':space-around,
  5. 'sb':space-between,
  6. 'se':space-evenly,
  7. 'c':center,
  8. 'fs':flex-start,
  9. 'fe':flex-end
  10. );
  11.  
  12. @each $key,$value in $justify{
  13. @if($key == $arg){
  14. @return $value;
  15. }
  16. }
  17. }
  18.  
  19. //Get the value for align-items
  20. @function checkAlign($arg){
  21. $align: (
  22. 'b':baseline,
  23. 's':stretch,
  24. 'c':center,
  25. 'fs':flex-start,
  26. 'fe':flex-end
  27. );
  28.  
  29. @each $key,$value in $align{
  30. @if($key == $arg){
  31. @return $value;
  32. }
  33. }
  34. }
  35.  
  36. //Display flex
  37. @mixin d-flex(){
  38. display: flex;
  39. @content
  40. }
  41.  
  42. //Applied example
  43. div{
  44. @include d-flex{
  45. justify-content: getJustify(c);
  46. align-content: getAlign(c);
  47. }
  48. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement