webseite/assets/sass/components/_form.scss

206 lines
3.8 KiB
SCSS
Raw Normal View History

2018-02-25 00:49:23 +01:00
///
/// Solid State by HTML5 UP
2018-02-25 00:49:23 +01:00
/// html5up.net | @ajlkn
/// Free for personal and commercial use under the CCA 3.0 license (html5up.net/license)
///
/* Form */
form {
margin: 0 0 _size(element-margin) 0;
2018-02-25 00:49:23 +01:00
.field {
margin: 0 0 _size(element-margin) 0;
2018-02-25 00:49:23 +01:00
label {
margin-top: _size(element-margin) * -0.75;
2018-02-25 00:49:23 +01:00
}
&:first-child {
label {
margin-top: 0;
2018-02-25 00:49:23 +01:00
}
}
}
> :last-child {
margin-bottom: 0;
2018-02-25 00:49:23 +01:00
}
}
label {
color: _palette(fg-bold);
display: block;
font-family: _font(family-heading);
font-size: 0.8em;
font-weight: _font(weight-heading-bold);
letter-spacing: _font(kern-heading);
margin: 0 0 (_size(element-margin) * 0.35) 0;
2018-02-25 00:49:23 +01:00
text-transform: uppercase;
}
input[type="text"],
input[type="password"],
input[type="email"],
input[type="tel"],
select,
textarea {
@include vendor('appearance', 'none');
background: _palette(border-bg);
2018-02-25 00:49:23 +01:00
border-radius: _size(border-radius);
border: none;
border: solid 2px _palette(border);
2018-02-25 00:49:23 +01:00
color: inherit;
display: block;
outline: 0;
padding: 0 1em;
2018-02-25 00:49:23 +01:00
text-decoration: none;
width: 100%;
&:invalid {
box-shadow: none;
}
&:focus {
border-color: desaturate(lighten(_palette(accent), 6), 3);
2018-02-25 00:49:23 +01:00
}
}
.select-wrapper {
@include icon;
display: block;
position: relative;
&:before {
color: _palette(border);
content: '\f078';
2018-02-25 00:49:23 +01:00
display: block;
height: _size(element-height);
line-height: _size(element-height);
2018-02-25 00:49:23 +01:00
pointer-events: none;
position: absolute;
right: 0;
text-align: center;
top: 0;
width: _size(element-height);
}
select::-ms-expand {
display: none;
}
}
select {
option {
color: _palette(fg-bold);
background: _palette(bg);
}
}
2018-02-25 00:49:23 +01:00
input[type="text"],
input[type="password"],
input[type="email"],
select {
height: _size(element-height);
}
textarea {
padding: 0.75em 1em;
2018-02-25 00:49:23 +01:00
}
input[type="checkbox"],
input[type="radio"], {
@include vendor('appearance', 'none');
display: block;
float: left;
margin-right: -2em;
2018-02-25 00:49:23 +01:00
opacity: 0;
width: 1em;
2018-02-25 00:49:23 +01:00
z-index: -1;
& + label {
@include icon;
color: _palette(fg);
cursor: pointer;
display: inline-block;
font-size: 1em;
font-family: _font(family);
text-transform: none;
letter-spacing: 0;
2018-02-25 00:49:23 +01:00
font-weight: _font(weight);
padding-left: (_size(element-height) * 0.6) + 0.75em;
padding-right: 0.75em;
2018-02-25 00:49:23 +01:00
position: relative;
&:before {
background: _palette(border-bg);
2018-02-25 00:49:23 +01:00
border-radius: _size(border-radius);
border: solid 2px _palette(border);
2018-02-25 00:49:23 +01:00
content: '';
display: inline-block;
height: (_size(element-height) * 0.6);
left: 0;
line-height: (_size(element-height) * 0.575);
2018-02-25 00:49:23 +01:00
position: absolute;
text-align: center;
top: 0;
2018-02-25 00:49:23 +01:00
width: (_size(element-height) * 0.6);
}
}
&:checked + label {
&:before {
background: _palette(fg-bold);
border-color: _palette(fg-bold);
2018-02-25 00:49:23 +01:00
content: '\f00c';
color: _palette(bg);
2018-02-25 00:49:23 +01:00
}
}
&:focus + label {
&:before {
border-color: _palette(accent);
2018-02-25 00:49:23 +01:00
}
}
}
input[type="checkbox"] {
& + label {
&:before {
border-radius: _size(border-radius);
}
}
}
input[type="radio"] {
& + label {
&:before {
border-radius: 100%;
}
}
}
::-webkit-input-placeholder {
color: _palette(fg-light) !important;
opacity: 1.0;
}
:-moz-placeholder {
color: _palette(fg-light) !important;
opacity: 1.0;
}
::-moz-placeholder {
color: _palette(fg-light) !important;
opacity: 1.0;
}
:-ms-input-placeholder {
color: _palette(fg-light) !important;
opacity: 1.0;
}
.polyfill-placeholder {
2018-02-25 00:49:23 +01:00
color: _palette(fg-light) !important;
opacity: 1.0;
}