2017-08-30 15:58:38 +02:00
|
|
|
//
|
|
|
|
// Forms
|
|
|
|
// ---
|
|
|
|
// ipdb.io
|
|
|
|
//
|
|
|
|
|
|
|
|
@import 'variables';
|
|
|
|
|
|
|
|
.form {
|
|
|
|
margin-bottom: $spacer;
|
2017-08-30 16:37:05 +02:00
|
|
|
|
|
|
|
@media ($screen-sm) {
|
|
|
|
max-width: 25rem;
|
|
|
|
}
|
2017-08-30 15:58:38 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
.form__group {
|
|
|
|
margin-bottom: $spacer / $line-height;
|
|
|
|
}
|
|
|
|
|
|
|
|
.form__label {
|
|
|
|
user-select: none;
|
|
|
|
display: block;
|
2017-08-30 16:37:05 +02:00
|
|
|
font-size: $font-size-mini;
|
|
|
|
font-weight: $font-weight-bold;
|
2017-08-30 15:58:38 +02:00
|
|
|
text-transform: uppercase;
|
2017-08-30 16:37:05 +02:00
|
|
|
color: $brand-02;
|
2017-08-30 15:58:38 +02:00
|
|
|
margin-bottom: $spacer / 4;
|
|
|
|
|
|
|
|
.required & {
|
|
|
|
&:after {
|
|
|
|
content: '*';
|
|
|
|
color: $brand-01;
|
|
|
|
padding-left: .1rem;
|
|
|
|
padding-right: .1rem;
|
|
|
|
}
|
|
|
|
}
|
2017-09-04 12:25:53 +02:00
|
|
|
|
|
|
|
&.valid {
|
|
|
|
color: $brand-success;
|
|
|
|
|
|
|
|
&:after { display: none; }
|
|
|
|
}
|
|
|
|
|
|
|
|
&.error {
|
|
|
|
color: $brand-failure;
|
|
|
|
|
|
|
|
&:after { display: none; }
|
|
|
|
|
|
|
|
a {
|
|
|
|
text-decoration: underline;
|
|
|
|
}
|
|
|
|
}
|
2017-08-30 15:58:38 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
.form__control {
|
|
|
|
display: block;
|
|
|
|
width: 100%;
|
|
|
|
max-width: 100%;
|
|
|
|
appearance: none;
|
|
|
|
padding: $spacer / 3 $spacer / 2;
|
2017-08-30 16:37:05 +02:00
|
|
|
margin: 0;
|
2017-08-30 15:58:38 +02:00
|
|
|
font-family: $font-family-base;
|
|
|
|
font-size: $font-size-base;
|
|
|
|
font-weight: $font-weight-bold;
|
|
|
|
box-shadow: none;
|
|
|
|
border: 1.5px solid darken($brand-05, 10%);
|
|
|
|
border-radius: $border-radius / 2;
|
|
|
|
color: $brand-03;
|
|
|
|
background: lighten($brand-05, 4%);
|
|
|
|
transition: .15s ease-out;
|
|
|
|
|
|
|
|
&:focus {
|
|
|
|
outline: 0;
|
|
|
|
border-color: $brand-02;
|
|
|
|
background: $brand-05;
|
|
|
|
}
|
|
|
|
|
|
|
|
// Placeholder
|
|
|
|
&::placeholder {
|
2017-08-30 16:37:05 +02:00
|
|
|
color: $text-color;
|
|
|
|
opacity: .4;
|
|
|
|
font-weight: $font-weight-normal;
|
2017-08-30 15:58:38 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
&:disabled,
|
|
|
|
&[readonly] {
|
|
|
|
cursor: disabled;
|
|
|
|
|
|
|
|
// iOS fix for unreadable disabled content; see https://github.com/twbs/bootstrap/issues/11655.
|
|
|
|
opacity: 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
//
|
|
|
|
// Form Validation States
|
|
|
|
//
|
|
|
|
// Success style
|
|
|
|
&:valid:not(:focus):not(:placeholder-shown) {
|
|
|
|
&,
|
|
|
|
&:focus {
|
|
|
|
border-color: $brand-success;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// Error style
|
|
|
|
&:invalid:not(:focus):not(:placeholder-shown):not(select) {
|
|
|
|
&,
|
|
|
|
&:focus {
|
|
|
|
border-color: $brand-failure;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-08-30 18:43:08 +02:00
|
|
|
&textarea {
|
|
|
|
// for textarea-autogrow
|
|
|
|
resize: none;
|
|
|
|
box-sizing: content-box;
|
|
|
|
max-width: 95%;
|
|
|
|
}
|
2017-08-30 15:58:38 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
.form__help {
|
|
|
|
font-size: $font-size-small;
|
|
|
|
color: $brand-02;
|
2017-08-30 16:37:05 +02:00
|
|
|
line-height: 1.2;
|
|
|
|
display: inline-block;
|
|
|
|
margin-top: $spacer / 4;
|
2017-08-30 15:58:38 +02:00
|
|
|
|
|
|
|
input + & {
|
2017-08-30 16:37:05 +02:00
|
|
|
padding-right: $spacer / 2;
|
2017-08-30 15:58:38 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-08-30 18:53:46 +02:00
|
|
|
.input-group {
|
|
|
|
display: flex;
|
|
|
|
|
|
|
|
.form__control {
|
|
|
|
border-top-right-radius: 0;
|
|
|
|
border-bottom-right-radius: 0;
|
|
|
|
border-right: 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
.button {
|
|
|
|
border-top-left-radius: 0;
|
|
|
|
border-bottom-left-radius: 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-08-30 16:37:05 +02:00
|
|
|
//
|
|
|
|
// Size modifiers
|
|
|
|
//
|
|
|
|
.form__control--small {
|
|
|
|
font-size: $font-size-small;
|
|
|
|
padding-top: $spacer / 5;
|
|
|
|
padding-bottom: $spacer / 5;
|
|
|
|
}
|
|
|
|
|
2017-08-30 15:58:38 +02:00
|
|
|
|
|
|
|
//
|
|
|
|
// required indicator
|
|
|
|
//
|
|
|
|
.required {
|
|
|
|
color: $brand-01;
|
|
|
|
padding-left: .1rem;
|
|
|
|
padding-right: .1rem;
|
|
|
|
}
|