Darep/Beatstream

View on GitHub
app/assets/stylesheets/components/_modals.scss

Summary

Maintainability
Test Coverage
.modal-overlay {
  background: rgba(#000, 0.85);
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 20;

  &.show {
    display: block;
  }
}

.modal {
  @include border-radius(6px);
  @include transform(translate(-50%, -50%));
  background: #fff;
  margin: 0 auto;
  padding: 40px;
  position: absolute;
  top: 50%;
  left: 50%;
  width: 500px;

  * + * {
    margin-top: 1.5em;
  }

  .margins-off {
    > * + * {
      margin-top: 0;
    }
  }
}

.modal--alert {
  text-align: center;
}

.modal__header {
  .close {
    font-size: 18px;
    position: absolute;
    top: 10px;
    right: 10px;

    &:hover {
      color: $color-gray-light;
    }
  }
}

.modal__title,
.modal__subtitle {
  margin: 0;
}

.modal__title {
  font-size: 24px;
  font-weight: 700;
}

.modal__subtitle {
  color: $color-gray-light;
  font-size: 14px;
}

.modal__body {
  font-size: 14px;
}

.modal__footer {
  text-align: right;

  .modal--alert & {
    text-align: center;
  }
}