alookatommorow/children-of-mex

View on GitHub
app/assets/stylesheets/modules/form.scss

Summary

Maintainability
Test Coverage
form {
  font-size: 1rem;
  position: relative;
  max-width: 100%;

  .field {
    clear: both;
    margin: 0em 0em 1em;

    .label {
      display: block;
      margin: 0em 0em 0.28571429rem 0em;
      color: rgba(0,0,0,0.87);
      font-size: 0.92857143em;
      font-weight: bold;
      text-transform: none;
    }
  }

  textarea {
    margin: 0em;
    -webkit-appearance: none;
    tap-highlight-color: rgba(255, 255, 255, 0);
    padding: 0.78571429em 1em;
    background: #ffffff;
    border: 1px solid rgba(34, 36, 38, 0.15);
    outline: none;
    color: rgba(0, 0, 0, 0.87);
    border-radius: 0.28571429rem;
    box-shadow: 0em 0em 0em 0em transparent inset;
    -webkit-transition: color 0.1s ease, border-color 0.1s ease;
    transition: color 0.1s ease, border-color 0.1s ease;
    font-size: 1em;
    line-height: 1.2857;
    resize: vertical;

    &:not([rows]) {
      width: 100%;
      height: 12em;
      min-height: 8em;
      max-height: 24em;
    }

    &:focus {
      border: 1px solid rgba(109, 183, 247, 1);
    }

    &.error {
      background: #fff6f6;
      border-color: #e0b4b4;
      color: #9f3a38;
    }
  }

  input[type="date"], input[type="datetime-local"], input[type="email"], input[type="number"], input[type="password"], input[type="search"], input[type="tel"], input[type="time"], input[type="text"], input[type="file"], input[type="url"] {
    width: 100%;
    vertical-align: top;
    margin: 0em;
    outline: none;
    -webkit-appearance: none;
    tap-highlight-color: rgba(255, 255, 255, 0);
    line-height: 1.2142em;
    padding: 0.67861429em 1em;
    font-size: 1em;
    background: #ffffff;
    border: 1px solid rgba(34, 36, 38, 0.15);
    color: rgba(0, 0, 0, 0.87);
    border-radius: 0.28571429rem;
    box-shadow: 0em 0em 0em 0em transparent inset;
    -webkit-transition: color 0.1s ease, border-color 0.1s ease;
    transition: color 0.1s ease, border-color 0.1s ease;

    &:focus {
      border: 1px solid rgba(109, 183, 247, 1);
    }

    &.error {
      background: #fff6f6;
      border-color: #e0b4b4;
      color: #9f3a38;
      border-radius: '';
      box-shadow: none;
    }
  }
}

.user-message {
  display: none;
  font-size: 1em;
  min-height: 1em;
  margin: 1em 0em;
  background: #f8f8f9;
  padding: 1em 1.5em;
  line-height: 1.4285em;
  color: rgba(0, 0, 0, 0.87);
  border-radius: 0.28571429rem;
  box-shadow: 0px 0px 0px 1px rgba(34, 36, 38, 0.22) inset, 0px 0px 0px 0px rgba(0, 0, 0, 0);

  &.error {
    box-shadow: 0px 0px 0px 1px #e0b4b4 inset,0px 0px 0px 0px transparent;
    background-color: #fff6f6;
    color: #9f3a38;

    .header {
      color: #912d2b;
    }
  }

  .error-list {
    text-align: left;
    padding: 0em;
    opacity: 0.85;
    list-style-position: inside;
    margin: 0.5em 0em 0em;

    li {
      position: relative;
      margin: 0em 0em 0.3em 1em;
      padding: 0em;
    }
  }

  &.success {
      box-shadow: 0 0 0 1px #A3C293 inset,0 0 0 0 transparent;
      background-color: #FCFFF5;
      color: #2C662D;
      text-align: center
  }

  .header {
    display: block;
    font-family: 'Lato', 'Helvetica Neue', Arial, Helvetica, sans-serif;
    font-weight: bold;
    margin: -0.14285em 0em 0rem 0em;
    font-size: 1.14285714em;

    p {
      opacity: 0.85;
      margin: 0.75em 0em;

      &:first-child {
        margin-top: 0em;
      }

      p:last-child {
        margin-bottom: 0em;
      }
    }
  }
}