KNACSS/sass/components/forms.scss
2017-07-31 20:34:26 +02:00

106 lines
2.4 KiB
SCSS

/* ----------------------------- */
/* ==Forms */
/* ----------------------------- */
/* thanks to HTML5boilerplate and https://shoelace.style/ */
/* forms items */
form,
fieldset {
border: none;
}
fieldset {
padding: $medium-value;
& legend {
padding: 0 $tiny-value;
border: 0;
white-space: normal;
}
}
label {
display: inline-block;
vertical-align: middle;
cursor: pointer;
}
[type="color"],
[type="date"],
[type="datetime-local"],
[type="email"],
[type="month"],
[type="number"],
[type="password"],
[type="search"],
[type="tel"],
[type="text"],
[type="time"],
[type="url"],
[type="week"]
select,
textarea {
white-space: nowrap;
font-family: inherit;
font-size: inherit;
border: 0;
box-shadow: 0 0 0 1px $color-border inset;
color: $color-base;
vertical-align: middle;
padding: $tiny-value $small-value;
margin: 0;
transition: 0.25s;
transition-property: box-shadow, background-color, color, border;
-webkit-appearance: none;
-moz-appearance: none;
appearance: none;
}
input[disabled] {
opacity: .5;
cursor: not-allowed;
}
input[readonly] {
background-color: $color-muted;
}
select {
padding-right: 2rem;
border-radius: $border-radius;
background-image: url("data:image/svg+xml,%3C%3Fxml version='1.0' encoding='UTF-8'%3F%3E%3Csvg width='41px' height='26px' viewBox='0 0 41 26' version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'%3E%3Cdefs%3E%3C/defs%3E%3Cg id='Page-1' stroke='none' stroke-width='1' fill='none' fill-rule='evenodd'%3E%3Cpolygon id='Path-3' fill='%23000000' points='0 5.38215461 19.9830489 25.3652035 40.1398855 5.20836689 34.9315186 0 19.8691842 15.0623344 4.83971338 0.0328636246'%3E%3C/polygon%3E%3C/g%3E%3C/svg%3E%0A");
background-position: right .5rem center;
background-repeat: no-repeat;
background-size: 1rem;
}
textarea {
min-height: 5em;
vertical-align: top;
resize: vertical;
white-space: normal;
}
/* 'x' appears on right of search input when text is entered. This removes it */
input[type="search"] {
&::-webkit-search-decoration,
&::-webkit-search-cancel-button,
&::-webkit-search-results-button,
&::-webkit-search-results-decoration {
display: none;
}
}
::-webkit-input-placeholder {
color: #777;
}
input:-moz-placeholder,
textarea:-moz-placeholder {
color: #777;
}
progress {
width: 100%;
vertical-align: middle;
}