Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Get the value for justify-content
- @function getJustify($arg){
- $justify: (
- 'sa':space-around,
- 'sb':space-between,
- 'se':space-evenly,
- 'c':center,
- 'fs':flex-start,
- 'fe':flex-end
- );
- @each $key,$value in $justify{
- @if($key == $arg){
- @return $value;
- }
- }
- }
- //Get the value for align-items
- @function checkAlign($arg){
- $align: (
- 'b':baseline,
- 's':stretch,
- 'c':center,
- 'fs':flex-start,
- 'fe':flex-end
- );
- @each $key,$value in $align{
- @if($key == $arg){
- @return $value;
- }
- }
- }
- //Display flex
- @mixin d-flex(){
- display: flex;
- @content
- }
- //Applied example
- div{
- @include d-flex{
- justify-content: getJustify(c);
- align-content: getAlign(c);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement