$unit-values: (
        1px: 1px,
        2px: 2px,
        3px: 3px,
        d25rem: 0.25rem,
        d5rem: 0.5rem,
        d75rem: 0.75rem,
        1rem: 1rem,
        2rem: 2rem,
        3rem: 3rem,
        d25em: 0.25em,
        d5em: 0.5em,
        d75em: 0.75em,
        1em: 1em,
        2em: 2em,
        3em: 3em,
);

/* hidden attribute */
[hidden] {
  display: none !important;
}

@mixin base-classes($prefix) {
  /* display none */
  .#{$prefix}display--none {
    display: none;
  }

  /* display-grid */
  .#{$prefix}display--grid {
    display: grid;
    grid-auto-rows: min-content;
  }

  /* grid-template-columns */
  @for $i from 1 through 12 {
    .#{$prefix}grid-template-columns--#{$i}fr {
      grid-template-columns: repeat($i, 1fr);
    }
  }
  /* grid-span */
  @for $i from 1 through 12 {
    .#{$prefix}grid-column--span-#{$i} {
      grid-column: span #{$i};
    }
  }
  /* flex */
  .#{$prefix}display--flex {
    display: flex;
    display: -ms-flexbox;
  }

  /* flex-direction */
  @each $value in row row-reverse column column-reverse {
    .#{$prefix}flex-direction--#{$value} {
      flex-direction: #{$value};
    }
  }

  /* flex-wrap */
  @each $value in wrap nowrap {
    .#{$prefix}flex-wrap--#{$value} {
      flex-wrap: #{$value};
    }
  }

  /* flex */
  @for $i from 0 through 12 {
    .#{$prefix}flex--#{$i} {
      flex: $i;
    }
  }

  /* gap, row-gap, column-gap */
  @each $name, $value in $unit-values {
    .#{$prefix}gap--#{$name} {
      gap: #{$value};
    }
    .#{$prefix}row-gap--#{$name} {
      row-gap: #{$value};
    }
    .#{$prefix}column-gap--#{$name} {
      column-gap: #{$value};
    }
  }

  /* justify-content */
  @each $value in start center end space-between space-around space-evenly {
    .#{$prefix}justify-content--#{$value} {
      justify-content: #{$value};
    }
  }

  /* align-item */
  @each $value in start center end {
    .#{$prefix}align-items--#{$value} {
      align-items: #{$value};
    }
  }

  /* justify-self */
  @each $value in start center end {
    .#{$prefix}justify-self--#{$value} {
      justify-self: #{$value};
    }
  }

  /* align-self */
  @each $value in start center end {
    .#{$prefix}align-self--#{$value} {
      align-self: #{$value};
    }
  }

  /* table-layout */
  @each $value in auto fixed {
    .#{$prefix}table-layout--#{$value} {
      table-layout: #{$value};
    }
  }

  /* margin */
  @each $name, $value in $unit-values {
    .#{$prefix}margin--#{$name} {
      margin: #{$value};
    }
    // with direction
    @each $direction in top right bottom left {
      .#{$prefix}margin-#{$direction}--#{$name} {
        margin-#{$direction}: #{$value};
      }
    }
  }

  /* padding */
  @each $name, $value in $unit-values {
    .#{$prefix}padding--#{$name} {
      padding: #{$value};
    }
    // with direction
    @each $direction in top right bottom left {
      .#{$prefix}padding-#{$direction}--#{$name} {
        padding-#{$direction}: #{$value};
      }
    }
  }

  /* white-space */
  @each $value in nowrap pre pre-line pre-wrap {
    .#{$prefix}white-space--#{$value} {
      white-space: #{$value};
    }
  }

  /* overflow */
  @each $value in auto scroll hidden  {
    .#{$prefix}overflow--#{$value} {
      overflow: #{$value};
    }
    .#{$prefix}overflow-x--#{$value} {
      overflow-x: #{$value};
    }
    .#{$prefix}overflow-y--#{$value} {
      overflow-y: #{$value};
    }
  }

  /* border */
  .#{$prefix}border--none {
    border: none;
  }

  /* border-style */
  @each $value in solid dotted dashed groove double {
    .#{$prefix}border-style--#{$value} {
      border-style: #{$value};
    }
  }

  /* border-width */
  @each $name, $value in $unit-values {
    .#{$prefix}border-width--#{$name} {
      border-width: #{$value};
    }
    // with direction
    @each $direction in top right bottom left {
      .#{$prefix}border-#{$direction}-width--#{$name} {
        border-#{$direction}-width: #{$value};
      }
    }
  }

  /* border-radius */
  @for $i from 1 through 3 {
    @each $name, $value in $unit-values {
      .#{$prefix}border-radius--#{$name} {
          border-radius: #{$value} !important;
      }
    }
  }
  @for $i from 1 through 5 {
    $value: $i*10;
    .#{$prefix}border-radius--#{$value} {
      border-radius: #{$value + '%'} !important;
    }
  }

  /* font-size */
  @each $name, $value in $unit-values {
    .#{$prefix}font-size--#{$name} {
      font-size: #{$value};
    }
  }

  // with keyword
  @each $value in small large smaller larger xx-small x-small small medium x-large xx-large {
    .#{$prefix}font-size--#{$value} {
      font-size: #{$value};
    }
  }

  /* font-weight */
  @each $value in thin normal bold {
    .#{$prefix}font-weight--#{$value} {
      font-weight: #{$value};
    }
  }

  /* font-style */
  @each $value in normal italic oblique {
    .#{$prefix}font-style--#{$value} {
      font-style: #{$value} !important;
    }
  }

  /* text-decoration */
  @each $value in none underline line-through {
    .#{$prefix}text-decoration--#{$value} {
      text-decoration: #{$value} !important;
    }
  }

  /* width */
  @for $i from 1 through 20 {
    $value: $i*5;
    .#{$prefix}width--#{$value} {
      width: #{$value + '%'};
    }
    .#{$prefix}width--#{$value}vw {
      width: #{$value + 'vw'};
    }
    .#{$prefix}min-width--#{$value} {
      min-width: #{$value + '%'};
    }
    .#{$prefix}min-width--#{$value}vw {
      min-width: #{$value + 'vw'};
    }
    .#{$prefix}max-width--#{$value} {
      max-width: #{$value + '%'};
    }
    .#{$prefix}max-width--#{$value}vw {
      max-width: #{$value + 'vw'};
    }
  }
  @for $i from 1 through 3 {
    @each $unit in rem em {
      .#{$prefix}width--#{$i + $unit} {
        width: #{$i + $unit};
      }
      .#{$prefix}min-width--#{$i + $unit} {
        min-width: #{$i + $unit};
      }
      .#{$prefix}max-width--#{$i + $unit} {
        max-width: #{$i + $unit};
      }
    }
  }

  /* height */
  @for $i from 1 through 10 {
    $value: $i*10;
    .#{$prefix}height--#{$value} {
      height: #{$value + '%'};
    }
    .#{$prefix}height--#{$value}vh {
      height: #{$value + 'vh'};
    }
    .#{$prefix}min-height--#{$value} {
      min-height: #{$value + '%'};
    }
    .#{$prefix}min-height--#{$value}vh {
      min-height: #{$value + 'vh'};
    }
    .#{$prefix}max-height--#{$value} {
      max-height: #{$value + '%'};
    }
    .#{$prefix}max-height--#{$value}vh {
      max-height: #{$value + 'vh'};
    }
  }
  @for $i from 1 through 3 {
    @each $unit in rem em {
      .#{$prefix}height--#{$i + $unit} {
        height: #{$i + $unit};
      }
      .#{$prefix}min-height--#{$i + $unit} {
        min-height: #{$i + $unit};
      }
      .#{$prefix}max-height--#{$i + $unit} {
        max-height: #{$i + $unit};
      }
    }
  }

  /* text-align */
  @each $value in left center right {
    .#{$prefix}text-align--#{$value} {
      text-align: #{$value};
    }
  }

  /* vertical-align */
    @each $value in baseline top middle bottom text-top text-bottom sub super {
        .#{$prefix}vertical-align--#{$value} {
        vertical-align: #{$value};
        }
    }

  /* cursor */
  @each $value in pointer now-allowed move {
    .#{$prefix}cursor--#{$value} {
      cursor: #{$value};
    }
  }
}

@include base-classes('');
@media screen and (max-width: 1023px) {
  @include base-classes('s__');
}

