_form-check.scss 1.5 KB
Newer Older
C
codecalm 已提交
1 2 3 4 5 6 7
/*
Form check
 */
.form-check {
  user-select: none;

  &.form-check-highlight .form-check-input:not(:checked) ~ .form-check-label {
P
Paweł Kuna 已提交
8 9 10 11 12 13 14 15 16 17 18 19 20
    color: var(--#{$prefix}muted);
  }

  .form-check-label-off {
    color: var(--#{$prefix}muted);
  }

  .form-check-input:checked ~ .form-check-label-off {
    display: none;
  }

  .form-check-input:not(:checked) ~ .form-check-label-on {
    display: none;
C
codecalm 已提交
21 22 23 24 25
  }
}

.form-check-input {
  background-size: $form-check-input-width;
26
  margin-top: ($form-check-min-height - $form-check-input-width) * .5;
27 28
  box-shadow: $form-check-input-box-shadow;
  
C
codecalm 已提交
29
  .form-switch & {
30
    @include transition(background-color$transition-time, background-position $transition-time);
C
codecalm 已提交
31 32 33 34 35
  }
}

.form-check-label {
  display: block;
36 37 38 39 40 41 42 43

  &.required {
    &:after {
      content: "*";
      margin-left: .25rem;
      color: $red;
    }
  }
C
codecalm 已提交
44 45 46 47
}

.form-check-description {
  display: block;
C
codecalm 已提交
48
  color: var(--#{$prefix}muted);
C
codecalm 已提交
49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67
  font-size: $h5-font-size;
  margin-top: .25rem;
}


.form-check-single {
  margin: 0;

  .form-check-input {
    margin: 0;
  }
}

/*
Form switch
 */
.form-switch {
  .form-check-input {
    height: $form-switch-height;
68
    margin-top: ($form-check-min-height - $form-switch-height) * .5;
C
codecalm 已提交
69
  }
C
codecalm 已提交
70 71 72
}

.form-switch-lg {
P
Paweł Kuna 已提交
73 74 75
  padding-left: 3.5rem;
  min-height: 1.5rem;

C
codecalm 已提交
76 77 78 79
  .form-check-input {
    height: 1.5rem;
    width: 2.75rem;
    background-size: 1.5rem;
P
Paweł Kuna 已提交
80 81 82 83 84
    margin-left: -3.5rem;
  }

  .form-check-label {
    padding-top: .125rem;
C
codecalm 已提交
85
  }
86 87 88 89 90
}

/*Correction of Form-check position*/
.form-check-input:checked{
  border: none;
C
codecalm 已提交
91
}