1
0
mirror of https://github.com/ipdb/website.git synced 2024-12-01 21:57:10 +01:00
website/_src/_assets/scss/_forms.scss

166 lines
2.9 KiB
SCSS
Raw Normal View History

2017-08-30 15:58:38 +02:00
//
// Forms
// ---
// ipdb.io
//
@import 'variables';
.form {
margin-bottom: $spacer;
@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;
font-size: $font-size-mini;
font-weight: $font-weight-bold;
2017-08-30 15:58:38 +02:00
text-transform: uppercase;
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;
}
}
&.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;
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 {
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;
}
}
&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;
line-height: 1.2;
display: inline-block;
margin-top: $spacer / 4;
2017-08-30 15:58:38 +02:00
input + & {
padding-right: $spacer / 2;
2017-08-30 15:58:38 +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;
}
}
//
// 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;
}