Commit b1aa8480 by Johannes Schill

feat: Add css-support for invalid form input elements

parent e5759fa0
......@@ -203,7 +203,7 @@ $input-border: 1px solid $input-border-color;
}
// Customize the `:focus` state to imitate native WebKit styles.
@include form-control-focus();
@include form-control-focus(false);
// Placeholder
&::placeholder {
......@@ -251,6 +251,10 @@ $input-border: 1px solid $input-border-color;
&--plaintext {
white-space: unset;
}
&--invalid {
@include form-control-focus(true);
}
}
.gf-form-hint {
......
......@@ -30,12 +30,19 @@
}
}
@mixin form-control-focus() {
@mixin form-control-focus($error) {
&:focus {
$shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075),
0 0 5px $input-box-shadow-focus;
border-color: $input-border-focus;
outline: none;
@if $error == true {
border-color: $brand-warning;
$shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075),
0 0 5px $input-box-shadow-focus;
0 0 5px $brand-warning;
}
@include box-shadow($shadow);
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment