.form-control-color {
width: $form-color-width;
- height: auto; // Override fixed browser height
+ height: $input-height;
padding: $input-padding-y;
&:not(:disabled):not([readonly]) {
}
&::-moz-color-swatch {
- height: if(unit($input-line-height) == "", $input-line-height * 1em, $input-line-height);
+ border: 0 !important; // stylelint-disable-line declaration-no-important
@include border-radius($input-border-radius);
}
&::-webkit-color-swatch {
- height: if(unit($input-line-height) == "", $input-line-height * 1em, $input-line-height);
@include border-radius($input-border-radius);
}
+
+ &.form-control-sm { height: $input-height-sm; }
+ &.form-control-lg { height: $input-height-lg; }
}
## Color
+Set the `type="color"` and add `.form-control-color` to the `<input>`. We use the modifier class to set fixed `height`s and override some inconsistencies between browsers.
+
{{< example >}}
<label for="exampleColorInput" class="form-label">Color picker</label>
<input type="color" class="form-control form-control-color" id="exampleColorInput" value="#563d7c" title="Choose your color">