Vuesax: Margin and padding helper classes

Created on 4 Jun 2018  路  4Comments  路  Source: lusaxweb/vuesax

Maybe some margin and padding helpers would be nice for this amazing design. Here is an example:

$spaceamounts: (5, 10, 15, 20, 25, 30, 35, 40, 45, 50, 75, 100);
$sides: (top, bottom, left, right);

@each $space in $spaceamounts {
  @each $side in $sides {
    .m-#{str-slice($side, 0, 1)}-#{$space} {
      margin-#{$side}: #{$space}px !important;
    }

    .p-#{str-slice($side, 0, 1)}-#{$space} {
      padding-#{$side}: #{$space}px !important;
    }
  }
}
enhancement good first issue help wanted

All 4 comments

This excellent to be able to do a PR on this is a very good thanks for the contribution

Sure! No problem at all! This is an awesome package, by the way!

any updates on this being official?

it would be handy to have some "all sides", negative margins, height and width also

$sides: (top, bottom, left, right);
$amounts: (5, 10, 15, 20, 25, 30, 35, 40, 45, 50, 75, 100);

@each $amount in $amounts {
  .m-neg#{$amount} {
    margin: -#{$amount}px !important;
  }
  .m-#{$amount} {
    margin: #{$amount}px !important;
  }

  .p-#{$amount} {
    padding: #{$amount}px !important;
  }

  @each $side in $sides {
    .m-#{str-slice($side, 0, 1)}-neg#{$amount} {
      margin-#{$side}: -#{$amount}px !important;
    }
    .m-#{str-slice($side, 0, 1)}-#{$amount} {
      margin-#{$side}: #{$amount}px !important;
    }

    .p-#{str-slice($side, 0, 1)}-#{$amount} {
      padding-#{$side}: #{$amount}px !important;
    }
  }
}

@each $amount in $amounts {
  .h-#{$amount} {
    height: #{$amount}% !important;
  }

  .w-#{$amount} {
    width: #{$amount}% !important;
  }
}
Was this page helpful?
0 / 5 - 0 ratings

Related issues

jbienesdev picture jbienesdev  路  3Comments

andresilva-cc picture andresilva-cc  路  3Comments

jsinhSolanki picture jsinhSolanki  路  3Comments

mjmnagy picture mjmnagy  路  3Comments

Cuacha07 picture Cuacha07  路  3Comments