af83/chouette-core

View on GitHub
app/packs/stylesheets/base/_utilities.scss

Summary

Maintainability
Test Coverage
//-------------//
//  Utilities  //
//-------------//

.flex {
  display: flex;
}
.flex-row {
  flex-direction: row;
}
.flex-col {
  flex-direction: column;
}
.justify-center {
  justify-content: center;
}
.justify-start {
  justify-content: flex-start;
}
.justify-end {
  justify-content: flex-end;
}
.justify-between {
  justify-content: space-between;
}
.justify-around {
  justify-content: space-around;
}
.justify-evenly {
  justify-content: space-evenly;
}
.items-start {
  align-items: flex-start;
}
.items-center {
  align-items: center;
}
.items-end {
  align-items: flex-end;
}
.self-end {
  align-self: flex-end;
}
.self-center {
  align-self: center;
}
.self-start {
  align-self: flex-start;
}

.development-only {
  display: inline-block;
  background-color: #da9d4f;
  border-radius: 0.3em;
  color: white;
  padding: 0 0.5em;
  margin: 0 0.5em;
  font-size: 0.8em;
}

.mt-xs {
  margin-top: 10px !important;
}
.mt-sm {
  margin-top: 15px !important;
}
.mt-md {
  margin-top: 20px !important;
}
.mt-lg {
  margin-top: 40px !important;
}
.mb-xs {
  margin-bottom: 10px !important;
}
.mb-sm {
  margin-bottom: 15px !important;
}
.mb-md {
  margin-bottom: 20px !important;
}
.mb-lg {
  margin-bottom: 40px !important;
}
.ml-xs {
  margin-left: 10px !important;
}
.ml-sm {
  margin-left: 15px !important;
}
.ml-md {
  margin-left: 20px !important;
}
.ml-lg {
  margin-left: 40px !important;
}
.mr-xs {
  margin-right: 10px !important;
}
.mr-sm {
  margin-right: 15px !important;
}
.mr-md {
  margin-right: 20px !important;
}
.mr-lg {
  margin-right: 40px !important;
}
.mb-0 {
  margin-bottom: 0 !important;
}
.pt-0 {
  padding-top: 0 !important;
}
.m-0 {
  margin: 0;
}
.mx-0 {
  margin-right: 0 !important;
  margin-left: 0 !important;
}
.mr-auto {
  margin-right: auto;
}
.ml-auto {
  margin-left: auto;
}

@for $i from 5 through 100 {
  .w#{$i} {
    width: $i * 1%;
  }
}

.grow {
  flex-grow: 1;
}

.grow-0 {
  flex-grow: 0;
}

// Empty zones
@mixin emptyzone($col1, $col2) {
  background-image: linear-gradient(-45deg, $col1 25%, $col2 25%, $col2 50%, $col1 50%, $col1 75%, $col2 75%, $col2);
  background-size: 40px 40px;
}

.cellwrap {
  display: block;
  // To avoid white spaces between childrend inline-block
  letter-spacing: -0.31em;
  text-rendering: optimizespeed;
  font-weight: 400;

  > div {
    display: inline-block;
    // To avoid white spaces between children inline-block
    letter-spacing: normal;
    word-spacing: normal;
    text-rendering: auto;
    overflow: hidden;
    vertical-align: middle;
    min-width: 20px;

    + div {
      margin-left: 5px;
    }
    &.hidden:first-child {
      &,
      & + div {
        margin-left: 0;
      }
    }
  }
}