.c-radio

scss
.c-radio {
  display: none;

  @include element('info-message') {
    @include use-font('caption');
    color: use-color('grey', 'light');
    margin: -12px 0 0;
    padding: 0 0 0 20px;
    width: 100%;
  }

  + label {
    @include use-font('body', 'regular');
    cursor: pointer;
    display: inline-block;
    line-height: inherit;
    margin: 12px;
    padding-left: 24px;
    position: relative;
    text-transform: capitalize;

    // border radius
    &::before {
      border: 1px solid use-color('grey', light-alt);
      border-radius: 50%;
      content: '';
      display: block;
      height: 16px;
      left: 0;
      margin-top: -8px;
      position: absolute;
      top: 50%;
      width: 16px;
    }

    // .c-radio + label:after
    // inner circle
    &::after {
      background: use-color('grey', light);
      border-radius: 50%;
      content: '';
      display: block;
      height: 14px;
      left: 2px;
      margin-top: -6px;
      position: absolute;
      top: 50%;
      transition: 0.2s ease-in-out;
      width: 14px;
    }
  }

  &:checked + label {
    &::after {
      background: use-color(primary);
      height: 14px;
      left: 2px;
      margin-top: -6px;
      width: 14px;
    }
  }
}

Class for use the Chattigo radio input

Example

html
<input name="option" type="radio" class="c-radio" id="first">
<label for="first">first</label>
<p class="c-radio__info-message">
  *mensaje sobre la opción presentada
</p>

<input name="option" type="radio" class="c-radio" id="second">
<label for="second">second</label>

<input name="option" type="radio" class="c-radio" id="third">
<label for="third">third</label>

Requires

@function use-color()

@mixin use-font()

.c-checkbox

scss
.c-checkbox {
  display: none;

  + label {
    @include use-font('body', 'regular');
    cursor: pointer;
    display: inline-block;
    line-height: inherit;
    margin: 12px;
    padding-left: 24px;
    position: relative;
    text-transform: capitalize;

    &::before {
      border: 1px solid use-color('grey', light-alt);
      border-radius: 2px;
      color: use-color('base', 'white');
      content: '';
      display: block;
      height: 16px;
      left: 0;
      margin-top: -8px;
      position: absolute;
      top: 50%;
      width: 16px;
    }

    &::after {
      color: use-color('base', 'white');
      content: '';
      display: block;
      height: 0;
      left: 20%;
      margin-top: 0;
      position: absolute;
      top: 50%;
      width: 0;
    }
  }

  &:checked + label {
    &::after {
      background: use-color(primary);
      border-radius: 2px;
      content: '\e904';
      font-family: 'icomoon' !important;
      font-size: 12px;
      height: 12px;
      left: 0;
      margin-top: -8px;
      padding: 3px;
      top: 50%;
      width: 12px;
    }
  }
}

Class for use the Chattigo checkbox input

Example

html
<input name="option" type="checkbox" class="c-checkbox" id="first">
<label for="first">checkbox</label>

Requires

@function use-color()

@mixin use-font()

.c-switch

scss
.c-switch {
  display: none;

  @include element('label') {
    @include use-font('caption', 'regular');
    color: use-color('grey');
    display: inline-block;
    line-height: 14px;
  }

  @include if-block-has-modifier('c-switch', 'small', true) {
    + label {
      height: 11px;
      margin-right: 8px;
      max-width: 21px;
      min-width: 21px;
      padding: 2px;
      position: relative;
      
      &::after {
        height: 13px;
        left: 1px;
        top: 1px;
        width: 13px;
      }
    }

    &:checked + label {
      &::after {
        left: 99%;
        margin-left: -14px;
      }
    }
  }

  + label {
    background: use-color('grey', 'light-alt');
    border-radius: 20px;
    cursor: pointer;
    display: block;
    height: 20px;
    max-width: 50px;
    padding: 2px;
    position: relative;
    transition: background 0.3s ease;
    user-select: none;
    
    &::after {
      background: use-color(base, 'white');
      border-radius: 50%;
      content: '';
      height: 22px;
      left: 1px;
      position: absolute;
      top: 1px;
      transition: all 0.3s ease;
      width: 22px;
    }
  }

  &:checked + label {
    background: use-color('event', 'success');

    &::after {
      left: 98%;
      margin-left: -22px;
    }
  }

  &:disabled,
  &[disabled] {
    + label {
      background: use-color('grey', light-alt);
      cursor: not-allowed;
    }
  }

  &-container {
    display: flex;
    padding: 2px;
  }
}

Class for use the Chattigo checkbox switch

note: is important to not add any content in the label tag

Examples

html
<input type="checkbox" class="c-switch" id="first">
<label for="first"></label>
<br>
<input type="checkbox" class="c-switch" id="second" disabled="disabled">
<label for="second"></label>
html example small switch w/ label
<div class="c-switch-container">
  <input id="switcha" type="checkbox" class="c-switch c-switch--small">
  <label for="switcha"></label>
  <label class="c-switch__label">
    #CustomLabel
  </label>
</div>

Requires

@function use-color()