KNACSS/sass/components/forms.scss

107 lines
2.4 KiB
SCSS
Raw Normal View History

2013-09-12 11:59:14 +02:00
/* ----------------------------- */
2016-05-20 08:58:56 +02:00
/* ==Forms */
2013-09-12 11:59:14 +02:00
/* ----------------------------- */
2017-07-31 17:16:08 +02:00
/* thanks to HTML5boilerplate and https://shoelace.style/ */
2013-09-12 11:59:14 +02:00
/* forms items */
form,
fieldset {
2015-07-01 13:47:48 +02:00
border: none;
2013-09-12 11:59:14 +02:00
}
2014-05-07 10:45:47 +02:00
2017-07-31 17:16:08 +02:00
fieldset {
padding: $medium-value;
& legend {
padding: 0 $tiny-value;
border: 0;
white-space: normal;
}
}
2017-07-31 13:24:04 +02:00
label {
2017-07-31 17:16:08 +02:00
display: inline-block;
vertical-align: middle;
cursor: pointer;
2013-09-12 11:59:14 +02:00
}
2014-05-07 10:45:47 +02:00
2017-07-31 17:16:08 +02:00
input[type="color"],
input[type="date"],
input[type="datetime-local"],
input[type="email"],
input[type="month"],
input[type="number"],
input[type="password"],
input[type="search"],
input[type="tel"],
input[type="text"],
input[type="time"],
input[type="url"],
input[type="week"],
select,
textarea {
2017-07-31 17:19:03 +02:00
white-space: nowrap;
2017-07-31 17:16:08 +02:00
font-family: inherit;
font-size: inherit;
2017-07-31 17:55:18 +02:00
border: 0;
2017-07-31 18:00:49 +02:00
box-shadow: 0 0 0 1px $color-muted inset;
2017-03-03 16:51:48 +01:00
color: $color-base;
2017-07-31 17:16:08 +02:00
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;
}
2017-07-31 17:16:08 +02:00
input[disabled] {
opacity: .5;
cursor: not-allowed;
2013-09-12 11:59:14 +02:00
}
2014-05-07 10:45:47 +02:00
2017-07-31 17:16:08 +02:00
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;
2013-09-12 11:59:14 +02:00
}
2014-05-07 10:45:47 +02:00
2013-09-12 11:59:14 +02:00
textarea {
2015-07-01 13:47:48 +02:00
min-height: 5em;
vertical-align: top;
resize: vertical;
2017-07-31 17:19:03 +02:00
white-space: normal;
2013-09-12 11:59:14 +02:00
}
2014-05-07 10:45:47 +02:00
2013-09-12 11:59:14 +02:00
/* '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;
}
2013-09-12 11:59:14 +02:00
}
2014-05-07 10:45:47 +02:00
2013-09-12 11:59:14 +02:00
::-webkit-input-placeholder {
2015-07-01 13:47:48 +02:00
color: #777;
2013-09-12 11:59:14 +02:00
}
2014-05-07 10:45:47 +02:00
2013-09-12 11:59:14 +02:00
input:-moz-placeholder,
textarea:-moz-placeholder {
2015-07-01 13:47:48 +02:00
color: #777;
2013-09-12 11:59:14 +02:00
}
2017-07-31 17:16:08 +02:00
progress {
width: 100%;
vertical-align: middle;
}