_forms.scss 3.3 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 11
.form-label {
  display: block;
C
codecalm 已提交
12 13 14 15 16 17 18 19

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

C
codecalm 已提交
22 23 24 25
.form-label-description {
  float: right;
  font-weight: $font-weight-normal;
  color: $text-muted;
C
codecalm 已提交
26
  line-height: 1.5rem;
C
codecalm 已提交
27
  font-size: $small-font-size;
C
codecalm 已提交
28
}
29

C
codecalm 已提交
30 31 32 33
/**
Form hint
 */
.form-hint {
C
codecalm 已提交
34
  display: block;
C
codecalm 已提交
35 36
  font-size: $small-font-size;
  color: $text-muted;
37 38
  line-height: 1.25rem;

C
codecalm 已提交
39

C
codecalm 已提交
40 41 42 43 44 45 46 47
  &:last-child {
    margin-bottom: 0;
  }

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

C
codecalm 已提交
48 49 50
  .form-label + & {
    margin-top: -.5rem;
  }
C
codecalm 已提交
51

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

C
codecalm 已提交
59 60 61
/**
Form control
 */
C
chomik 已提交
62
.form-control {
C
chomik 已提交
63
  &:-webkit-autofill {
C
codecalm 已提交
64
    box-shadow: 0 0 0 1000px $white inset;
C
chomik 已提交
65 66
  }

C
chomik 已提交
67 68 69 70 71
  &:disabled,
  &.disabled {
    color: $text-muted;
    user-select: none;
  }
C
codecalm 已提交
72 73

  &[size] {
D
Dawid 已提交
74 75
    width: auto;
  }
C
codecalm 已提交
76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91

  &[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 已提交
92 93 94
}

.form-control-light {
C
codecalm 已提交
95 96 97 98 99
  background-color: $gray-100;
  border-color: transparent;
}

.form-control-dark {
C
codecalm 已提交
100 101
  background-color: rgba($black, .1);
  color: $white;
102
  border-color: transparent;
C
codecalm 已提交
103 104

  &:focus {
C
codecalm 已提交
105 106 107 108 109 110
    background-color: rgba($black, .1);
    box-shadow: none;
    border-color: rgba($white, .24);
  }

  &::placeholder {
C
codecalm 已提交
111
    color: rgba($white, .6);
C
codecalm 已提交
112
  }
C
chomik 已提交
113 114
}

C
codecalm 已提交
115 116 117 118 119 120 121 122 123 124 125 126 127
.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 已提交
128 129 130 131 132 133
.form-footer {
  margin-top: 2rem;
}

.form-fieldset {
  padding: 1rem;
C
chomik 已提交
134
  margin-bottom: 1rem;
C
chomik 已提交
135
  background: $min-black;
C
chomik 已提交
136 137 138 139
  border: 1px solid $border-color;
  border-radius: $border-radius;
}

C
chomik 已提交
140 141 142 143
/**
Form help
 */
.form-help {
C
codecalm 已提交
144
  display: inline-flex;
C
codecalm 已提交
145
  font-weight: $font-weight-bold;
C
codecalm 已提交
146 147 148 149 150
  align-items: center;
  justify-content: center;
  width: 1.125rem;
  height: 1.125rem;
  font-size: .75rem;
C
chomik 已提交
151
  color: $text-muted;
C
codecalm 已提交
152
  text-align: center;
C
chomik 已提交
153 154 155
  text-decoration: none;
  cursor: pointer;
  user-select: none;
C
codecalm 已提交
156
  background: $min-white;
C
codecalm 已提交
157
  border-radius: $border-radius-full;
C
codecalm 已提交
158
  transition: .3s background-color, .3s color;
C
chomik 已提交
159 160 161

  &:hover,
  &[aria-describedby] {
C
codecalm 已提交
162
    color: $white;
C
codecalm 已提交
163
    background: $primary;
C
chomik 已提交
164 165
  }
}
C
codecalm 已提交
166 167 168 169 170 171



/**
Input group
 */
C
codecalm 已提交
172 173 174 175
.input-group-link {
  font-size: $h5-font-size;
}

C
codecalm 已提交
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 201
.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 已提交
202 203 204
  .input-group-text {
    background: transparent;
    transition: $input-transition;
C
codecalm 已提交
205

C
codecalm 已提交
206
    &:first-child {
C
codecalm 已提交
207 208
      padding-right: 0;
    }
C
codecalm 已提交
209

C
codecalm 已提交
210
    &:last-child {
C
codecalm 已提交
211 212 213 214
      padding-left: 0;
    }
  }
}
C
codecalm 已提交
215 216 217 218 219 220 221 222 223


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