mirror of
https://github.com/grafana/grafana.git
synced 2025-02-13 17:15:40 -06:00
feat: Add css-support for invalid form input elements
This commit is contained in:
parent
e5759fa0ed
commit
b1aa84804b
@ -203,7 +203,7 @@ $input-border: 1px solid $input-border-color;
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Customize the `:focus` state to imitate native WebKit styles.
|
// Customize the `:focus` state to imitate native WebKit styles.
|
||||||
@include form-control-focus();
|
@include form-control-focus(false);
|
||||||
|
|
||||||
// Placeholder
|
// Placeholder
|
||||||
&::placeholder {
|
&::placeholder {
|
||||||
@ -251,6 +251,10 @@ $input-border: 1px solid $input-border-color;
|
|||||||
&--plaintext {
|
&--plaintext {
|
||||||
white-space: unset;
|
white-space: unset;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
&--invalid {
|
||||||
|
@include form-control-focus(true);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.gf-form-hint {
|
.gf-form-hint {
|
||||||
|
@ -30,12 +30,19 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@mixin form-control-focus() {
|
@mixin form-control-focus($error) {
|
||||||
&:focus {
|
&:focus {
|
||||||
|
$shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075),
|
||||||
|
0 0 5px $input-box-shadow-focus;
|
||||||
border-color: $input-border-focus;
|
border-color: $input-border-focus;
|
||||||
outline: none;
|
outline: none;
|
||||||
$shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075),
|
|
||||||
0 0 5px $input-box-shadow-focus;
|
@if $error == true {
|
||||||
|
border-color: $brand-warning;
|
||||||
|
$shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075),
|
||||||
|
0 0 5px $brand-warning;
|
||||||
|
}
|
||||||
|
|
||||||
@include box-shadow($shadow);
|
@include box-shadow($shadow);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user