components/sass/form/_index.scss
ポール ウェッブ ba2366c957 WIP
2019-02-05 18:03:03 -06:00

164 lines
2.9 KiB
SCSS

form {
margin-bottom: 1rem;
}
fieldset {
// Flexbox is broken for fieldset elements in Chromium
// Source: https://bugs.chromium.org/p/chromium/issues/detail?id=375693
// Example: https://codepen.io/Garbee/pen/oYKMYp
// display: flex; //
// justify-content: center; //
font-size: 1rem;
margin-bottom: 0.5rem;
position: relative;
// @supports (not (-moz-appearance: none)) {
// display: block;
// }
button,
input {
// height: 2.5rem;
// border-style: solid;
// border-width: 1px;
&:not([type="button"]):not([type="radio"]):not([type="submit"]) {
// flex: 1; //
padding-right: 1rem;
padding-left: 1rem;
transition: border 0.2s;
// @supports (not (-moz-appearance: none)) {
// width: calc(100% - 10rem);
// float: left;
// }
&:not(:focus) {
border-top-color: $lbry-black;
border-right-color: transparent;
border-bottom-color: $lbry-black;
border-left-color: $lbry-black;
}
&:focus {
border-top-color: $lbry-teal-5;
border-right-color: transparent;
border-bottom-color: $lbry-teal-5;
border-left-color: $lbry-teal-5;
}
}
&[type="button"],
&[type="submit"] {
color: $lbry-white;
padding-right: 1.5rem;
padding-left: 1.5rem;
transition: all 0.2s;
// @supports (not (-moz-appearance: none)) {
// width: 10rem;
// float: right;
// }
&:not(:hover) {
background-color: $lbry-black;
border-color: $lbry-black;
}
&:hover {
background-color: $lbry-teal-3;
border-color: $lbry-teal-5;
}
}
}
}
radio {
min-height: 2rem;
align-items: center;
display: inline-flex;
flex-direction: row-reverse;
position: relative;
&:hover {
label {
color: $lbry-teal-3;
}
check {
border-color: $lbry-teal-3;
}
}
label {
padding-left: 0.5rem;
transition: color 0.2s;
}
input {
&[type="radio"] {
width: 0; height: 0;
visibility: hidden;
&:not(:checked) {
+ label + check::before {
background-color: transparent;
}
}
&:checked {
+ label {
color: $lbry-teal-3;
}
+ label + check::before {
background-color: $lbry-teal-3;
}
}
}
}
}
check {
width: 1.5rem; height: 1.5rem;
top: 0; left: 0;
border: 2px solid;
border-radius: 50%;
display: block;
position: relative;
transition: border 0.2s;
z-index: 5;
&::before {
width: 0.75rem; height: 0.75rem;
top: 0.24rem; left: 0.24rem;
border-radius: 50%;
content: "";
display: block;
position: absolute;
transition: background-color 0.2s;
}
}
.check {
@extend check;
}
.fieldset {
@extend fieldset;
}
.form {
@extend form;
}
.radio-group {
@extend radio;
}