_forms.scss 3.5 KB
Newer Older
C
chomik 已提交
1 2 3 4 5 6
textarea {
  &[cols] {
    height: auto;
  }
}

C
codecalm 已提交
7 8 9
/**
Form label
 */
C
chomik 已提交
10
.form-label {
C
codecalm 已提交
11
  font-size: $h4-font-size;
C
codecalm 已提交
12
  font-weight: $font-weight-bold;
C
chomik 已提交
13
  display: block;
C
codecalm 已提交
14
  margin-bottom: .5rem;
C
chomik 已提交
15 16
}

C
codecalm 已提交
17 18 19 20 21
.form-label-description {
  float: right;
  font-weight: $font-weight-normal;
  color: $text-muted;
  line-height: $line-height-base * (100%/$small-font-size);
C
codecalm 已提交
22
  font-size: $small-font-size;
C
codecalm 已提交
23
}
24

C
codecalm 已提交
25 26 27 28
/**
Form hint
 */
.form-hint {
C
codecalm 已提交
29
  display: block;
C
codecalm 已提交
30 31
  font-size: $small-font-size;
  color: $text-muted;
C
codecalm 已提交
32
  line-height: $line-height-sm;
C
codecalm 已提交
33

C
codecalm 已提交
34 35 36 37 38 39 40 41
  &:last-child {
    margin-bottom: 0;
  }

  & + .form-control {
    margin-top: .25rem;
  }

C
codecalm 已提交
42 43 44
  .form-label + & {
    margin-top: -.5rem;
  }
C
codecalm 已提交
45 46 47 48 49

  .form-control + &,
  .form-select + & {
    margin-top: .25rem;
  }
C
codecalm 已提交
50 51
}

C
codecalm 已提交
52 53 54
/**
Form control
 */
C
chomik 已提交
55
.form-control {
C
chomik 已提交
56
  &:-webkit-autofill {
C
codecalm 已提交
57
    box-shadow: 0 0 0 1000px #ffffff inset;
C
chomik 已提交
58 59
  }

C
chomik 已提交
60 61 62 63 64
  &:disabled,
  &.disabled {
    color: $text-muted;
    user-select: none;
  }
C
codecalm 已提交
65 66

  &[size] {
D
Dawid 已提交
67 68
    width: auto;
  }
C
chomik 已提交
69 70 71
}

.form-control-light {
72 73
  background-color: $gray-100;
  border-color: transparent;
C
chomik 已提交
74 75
}

C
codecalm 已提交
76 77 78 79 80 81 82 83 84 85 86 87 88
.form-control-rounded {
  border-radius: 10rem;
}

.form-control-flush {
  padding: 0;
  background: none !important;
  border-color: transparent !important;
  resize: none;
  box-shadow: none !important;
  line-height: inherit;
}

C
chomik 已提交
89 90 91 92 93 94
.form-footer {
  margin-top: 2rem;
}

.form-fieldset {
  padding: 1rem;
C
chomik 已提交
95
  margin-bottom: 1rem;
C
chomik 已提交
96
  background: $min-black;
C
chomik 已提交
97 98 99 100 101 102 103 104
  border: 1px solid $border-color;
  border-radius: $border-radius;
}

.form-required {
  color: $red;
}

C
chomik 已提交
105 106 107 108
/**
Form help
 */
.form-help {
C
codecalm 已提交
109 110 111 112 113 114 115
  display: inline-flex;
  font-weight: 600;
  align-items: center;
  justify-content: center;
  width: 1.125rem;
  height: 1.125rem;
  font-size: .75rem;
C
chomik 已提交
116
  color: $text-muted;
C
codecalm 已提交
117
  text-align: center;
C
chomik 已提交
118 119 120
  text-decoration: none;
  cursor: pointer;
  user-select: none;
C
codecalm 已提交
121
  background: $min-white;
C
codecalm 已提交
122 123
  border-radius: 50%;
  transition: .3s background-color, .3s color;
C
chomik 已提交
124 125 126

  &:hover,
  &[aria-describedby] {
C
codecalm 已提交
127
    color: #ffffff;
C
codecalm 已提交
128
    background: $primary;
C
chomik 已提交
129 130
  }
}
C
codecalm 已提交
131 132 133 134

/**
Form switch
 */
C
codecalm 已提交
135 136
.form-check {
  user-select: none;
C
codecalm 已提交
137

138
  &.form-check-highlight .form-check-input:not(:checked) ~ .form-check-label {
C
codecalm 已提交
139
    opacity: .64;
C
codecalm 已提交
140 141 142
  }
}

C
codecalm 已提交
143 144 145 146 147 148 149 150 151 152
.form-check-input {
  margin-top: .25rem;
}

.form-check-label {
  line-height: $line-height-sm;
  padding: .125rem 0;
}

.form-check-description {
C
codecalm 已提交
153
  color: $text-muted;
C
codecalm 已提交
154 155
  font-size: $h5-font-size;
  line-height: $line-height-sm;
C
codecalm 已提交
156 157 158 159 160
}

/**
Input group
 */
C
codecalm 已提交
161 162 163 164 165 166 167
.input-group-prepend .input-group-text {
  border-right: 0;
}

.input-group-append .input-group-text {
  border-left: 0;
}
C
codecalm 已提交
168

C
codecalm 已提交
169 170 171 172
.input-group-link {
  font-size: $h5-font-size;
}

C
codecalm 已提交
173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200
.input-group-flat {
  &:focus-within {
    box-shadow: $input-focus-box-shadow;
    border-radius: $input-border-radius;

    .form-control,
    .input-group-text {
      border-color: $input-focus-border-color !important;
    }
  }

  .form-control {
    &:focus {
      border-color: $input-border-color;
      box-shadow: none;
    }

    &:not(:last-child) {
      border-right: 0;
    }

    &:not(:first-child) {
      border-left: 0;
    }
  }

  .input-group-prepend {
    margin-right: 0;
C
codecalm 已提交
201
    border-right: 0;
C
modals  
codecalm 已提交
202
    background: $form-check-input-bg;
C
codecalm 已提交
203 204 205 206 207 208 209 210 211

    .input-group-text {
      padding-right: 0;
    }
  }

  .input-group-append {
    margin-left: 0;

C
codecalm 已提交
212 213 214 215
    &:not(:last-child) .input-group-text {
      border-right: 0;
    }

C
codecalm 已提交
216 217 218 219 220 221 222 223 224 225
    .input-group-text {
      padding-left: 0;
    }
  }

  .input-group-text {
    background: transparent;
    transition: $input-transition;
  }
}
C
codecalm 已提交
226 227 228 229 230 231 232 233 234


/**
Upload files
 */
.form-file-button {
  margin-left: 0;
  border-left: 0;
}