Adding focus handling for buttons and inputs

This commit is contained in:
Stamm
2020-03-12 13:48:19 +01:00
parent 36cee2c1f7
commit aaabaa5250
7 changed files with 149 additions and 87 deletions

View File

@ -1,18 +1,20 @@
.inp {
background: unset;
border: 1px grey solid;
padding: 0 .5rem;
padding: 0 0.5rem;
height: 2rem;
display: inline-block;
min-width: 10rem;
outline: none;
&:focus {
border-width: 1px;
border-color: $primary;
}
}
textarea.inp {
height: unset !important;
height: unset;
min-height: 6rem !important;
}
@ -27,13 +29,12 @@ textarea.inp {
label {
display: inline-block;
margin-bottom: .3rem;
margin-left: .5rem;
margin-bottom: 0.3rem;
margin-left: 0.5rem;
}
}
.input-checkbox {
@extend .margin;
display: block;
@ -47,7 +48,6 @@ textarea.inp {
-ms-user-select: none;
user-select: none;
/* Hide the browser's default checkbox */
input {
position: absolute;
@ -64,16 +64,16 @@ textarea.inp {
left: 0;
height: 26px;
width: 26px;
transition: background-color .2s;
transition: background-color 0.2s;
}
/* On mouse-over, add a grey background color */
:hover input~span {
:hover input ~ span {
background-color: #ccc;
}
/* When the checkbox is checked, add a blue background */
input:checked~span {
input:checked ~ span {
background-color: $primary;
}
@ -85,11 +85,11 @@ textarea.inp {
}
/* Show the checkmark when checked */
input:checked~span:after {
input:checked ~ span:after {
display: block;
}
input[type=checkbox]+span:after {
input[type="checkbox"] + span:after {
/* Style the checkmark/indicator */
left: 9px;
top: 5px;
@ -100,7 +100,7 @@ textarea.inp {
transform: rotate(45deg);
}
input[type=radio]+span {
input[type="radio"] + span {
border-radius: 50%;
&:after {
@ -112,4 +112,4 @@ textarea.inp {
background-color: white;
}
}
}
}