Commit 0df8bee64a9f221c6502d9a95d0a10f90bf2b9ae

Authored by ly525
1 parent f9e05d06

perf: add spacing helper css

front-end/h5/src/components/core/styles/_spacing-helpers.scss 0 → 100644
  1 +$spaceamounts: (1, 2, 3, 4, 5, 6);
  2 +$sides: (top, bottom, left, right, all);
  3 +$gutter: 4;
  4 +
  5 +@function gen_spacing($space) {
  6 + @return #{$space * $gutter}px !important;
  7 +}
  8 +
  9 +@each $space in $spaceamounts {
  10 + @each $side in $sides {
  11 + @if $side == 'all' {
  12 + .m#{str-slice($side, 0, 1)}-#{$space} {
  13 + margin: gen_spacing($space);
  14 + }
  15 +
  16 + .p#{str-slice($side, 0, 1)}-#{$space} {
  17 + padding: gen_spacing($space);
  18 + }
  19 + } @else {
  20 + .m#{str-slice($side, 0, 1)}-#{$space} {
  21 + margin-#{$side}: gen_spacing($space);
  22 + }
  23 +
  24 + .p#{str-slice($side, 0, 1)}-#{$space} {
  25 + padding-#{$side}: gen_spacing($space);
  26 + }
  27 + }
  28 + }
  29 +}
0 30 \ No newline at end of file
... ...
front-end/h5/src/components/core/styles/index.scss
  1 +@import url("./_spacing-helpers.scss");
  2 +
1 3 @mixin shortcut-button {
2 4 border: 1px dashed #fff;
3 5 height: 60px;
... ...