KNACSS/sass/components/_forms.scss

117 lines
2.6 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-color: $gray-800 !default;
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: $spacer-medium;
2017-07-31 17:16:08 +02:00
& legend {
padding: 0 $spacer-tiny;
2017-07-31 17:16:08 +02:00
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;
cursor: pointer;
2013-09-12 11:59:14 +02:00
}
2014-05-07 10:45:47 +02:00
2017-07-31 20:34:26 +02:00
[type="color"],
[type="date"],
[type="datetime-local"],
[type="email"],
[type="month"],
[type="number"],
[type="password"],
[type="search"],
2017-07-31 20:47:46 +02:00
[type="submit"],
2017-07-31 20:34:26 +02:00
[type="tel"],
[type="text"],
[type="time"],
[type="url"],
2017-07-31 21:31:56 +02:00
[type="week"],
select,
textarea {
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-09-26 11:42:46 +02:00
box-shadow: 0 0 0 1px $forms-color inset;
2017-03-03 16:51:48 +01:00
color: $color-base;
2017-07-31 17:16:08 +02:00
vertical-align: middle;
padding: $spacer-tiny $spacer-small;
2017-07-31 17:16:08 +02:00
margin: 0;
transition: 0.25s;
transition-property: box-shadow, background-color, color, border;
appearance: none;
}
2017-07-31 20:47:46 +02:00
[type="submit"] {
2017-09-26 11:42:46 +02:00
background-color: $forms-color;
2017-10-13 10:59:40 +02:00
color: $white;
2017-07-31 21:31:56 +02:00
cursor: pointer;
2017-07-31 20:47:46 +02:00
}
2017-07-31 17:16:08 +02:00
input[readonly] {
background-color: $color-muted;
}
select {
padding-right: 2rem;
border-radius: $border-radius;
2017-08-02 09:36:13 +02:00
background-image: url("data:image/svg+xml,%3C%3Fxml%20version%3D%221.0%22%20standalone%3D%22no%22%3F%3E%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20xmlns%3Axlink%3D%22http%3A//www.w3.org/1999/xlink%22%20style%3D%22isolation%3Aisolate%22%20viewBox%3D%220%200%2020%2020%22%20width%3D%2220%22%20height%3D%2220%22%3E%3Cpath%20d%3D%22%20M%209.96%2011.966%20L%203.523%205.589%20C%202.464%204.627%200.495%206.842%201.505%207.771%20L%201.505%207.771%20L%208.494%2014.763%20C%209.138%2015.35%2010.655%2015.369%2011.29%2014.763%20L%2011.29%2014.763%20L%2018.49%207.771%20C%2019.557%206.752%2017.364%204.68%2016.262%205.725%20L%2016.262%205.725%20L%209.96%2011.966%20Z%20%22%20fill%3D%22inherit%22/%3E%3C/svg%3E");
background-position: right .6rem center;
2017-07-31 17:16:08 +02:00
background-repeat: no-repeat;
2017-08-02 09:36:13 +02:00
background-size: 1.2rem;
2013-09-12 11:59:14 +02:00
}
2014-05-07 10:45:47 +02:00
2017-09-22 11:21:20 +02:00
/* hiding IE11 arrow */
select::-ms-expand {
display: none;
}
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;
white-space: pre-wrap;
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 */
2017-07-31 20:37:21 +02:00
[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
2018-04-04 10:40:39 +02:00
input::placeholder,
textarea::placeholder {
color: #777;
}
2017-07-31 17:16:08 +02:00
progress {
width: 100%;
vertical-align: middle;
}