_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
 */
10
.col-form-label,
C
chomik 已提交
11 12
.form-label {
  display: block;
P
Paweł Kuna 已提交
13
  font-weight: $font-weight-medium;
C
codecalm 已提交
14 15 16 17 18 19 20 21

  &.required {
    &:after {
      content: "*";
      margin-left: .25rem;
      color: $red;
    }
  }
C
chomik 已提交
22 23
}

C
codecalm 已提交
24 25 26 27 28
.form-label-description {
  float: right;
  font-weight: $font-weight-normal;
  color: $text-muted;
}
29

C
codecalm 已提交
30 31 32 33
/**
Form hint
 */
.form-hint {
C
codecalm 已提交
34
  display: block;
C
codecalm 已提交
35
  color: $text-muted;
36

C
codecalm 已提交
37 38 39 40 41 42 43 44
  &:last-child {
    margin-bottom: 0;
  }

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

C
codecalm 已提交
45
  .form-label + & {
P
Paweł Kuna 已提交
46
    margin-top: -.25rem;
C
codecalm 已提交
47
  }
C
codecalm 已提交
48

49
  .input-group + &,
C
codecalm 已提交
50 51
  .form-control + &,
  .form-select + & {
52
    margin-top: .5rem;
C
codecalm 已提交
53
  }
C
codecalm 已提交
54 55
}

56 57 58 59 60
/**
Form select
 */
.form-select {
  &:-moz-focusring {
61
    color: var(--#{$prefix}body-color);
62 63 64
  }
}

C
codecalm 已提交
65 66 67
/**
Form control
 */
C
chomik 已提交
68
.form-control {
C
chomik 已提交
69
  &:-webkit-autofill {
70 71
    box-shadow: 0 0 0 1000px var(--#{$prefix}body-bg) inset;
    color: var(--#{$prefix}body-color);
C
chomik 已提交
72 73
  }

C
chomik 已提交
74 75 76 77 78
  &:disabled,
  &.disabled {
    color: $text-muted;
    user-select: none;
  }
C
codecalm 已提交
79 80

  &[size] {
D
Dawid 已提交
81 82
    width: auto;
  }
C
codecalm 已提交
83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98

  &[type="number"] {
    &::-webkit-inner-spin-button {
      opacity: 1;
      cursor: pointer;
      height: subtract($input-height, 1px);
      margin: 0 (-$input-padding-x) 0 0;
    }

    &::-moz-inner-spin-button {
      opacity: 1;
      cursor: pointer;
      height: subtract($input-height, 1px);
      margin: 0 (-$input-padding-x) 0 0;
    }
  }
C
chomik 已提交
99 100 101
}

.form-control-light {
C
codecalm 已提交
102 103 104 105 106
  background-color: $gray-100;
  border-color: transparent;
}

.form-control-dark {
C
codecalm 已提交
107 108
  background-color: rgba($black, .1);
  color: $white;
109
  border-color: transparent;
C
codecalm 已提交
110 111

  &:focus {
C
codecalm 已提交
112 113 114 115 116 117
    background-color: rgba($black, .1);
    box-shadow: none;
    border-color: rgba($white, .24);
  }

  &::placeholder {
C
codecalm 已提交
118
    color: rgba($white, .6);
C
codecalm 已提交
119
  }
C
chomik 已提交
120 121
}

C
codecalm 已提交
122 123 124 125 126 127 128 129 130 131 132 133 134
.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 已提交
135 136 137 138 139 140
.form-footer {
  margin-top: 2rem;
}

.form-fieldset {
  padding: 1rem;
C
chomik 已提交
141
  margin-bottom: 1rem;
142 143
  background: var(--#{$prefix}body-bg);
  border: 1px solid var(--#{$prefix}border-color);
C
chomik 已提交
144 145 146
  border-radius: $border-radius;
}

C
chomik 已提交
147 148 149 150
/**
Form help
 */
.form-help {
C
codecalm 已提交
151
  display: inline-flex;
C
codecalm 已提交
152
  font-weight: $font-weight-bold;
C
codecalm 已提交
153 154 155 156 157
  align-items: center;
  justify-content: center;
  width: 1.125rem;
  height: 1.125rem;
  font-size: .75rem;
C
chomik 已提交
158
  color: $text-muted;
C
codecalm 已提交
159
  text-align: center;
C
chomik 已提交
160 161 162
  text-decoration: none;
  cursor: pointer;
  user-select: none;
C
codecalm 已提交
163
  background: var(--#{$prefix}border-color-light);
C
codecalm 已提交
164
  border-radius: $border-radius-pill;
165
  @include transition(background-color $transition-time, color $transition-time);
C
chomik 已提交
166 167 168

  &:hover,
  &[aria-describedby] {
C
codecalm 已提交
169
    color: $white;
C
codecalm 已提交
170
    background: $primary;
C
chomik 已提交
171 172
  }
}
C
codecalm 已提交
173 174 175 176 177 178



/**
Input group
 */
C
codecalm 已提交
179 180 181 182
.input-group-link {
  font-size: $h5-font-size;
}

C
codecalm 已提交
183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208
.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;
    }
  }

C
codecalm 已提交
209 210
  .input-group-text {
    background: transparent;
211
    @include transition($input-transition);
C
codecalm 已提交
212

C
codecalm 已提交
213
    &:first-child {
C
codecalm 已提交
214 215
      padding-right: 0;
    }
C
codecalm 已提交
216

C
codecalm 已提交
217
    &:last-child {
C
codecalm 已提交
218 219 220 221
      padding-left: 0;
    }
  }
}
C
codecalm 已提交
222 223 224 225 226 227 228 229 230


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