ensl.org/app/assets/stylesheets/components/_forms.scss

272 lines
5.1 KiB
SCSS
Raw Normal View History

2014-04-06 14:14:03 +00:00
/*
Forms
*/
form {
.inline {
float: left;
display: inline-block;
width: auto;
margin-bottom: em(20);
input {
margin-bottom: 0;
}
}
.fields {
> .field_with_errors:first-child,
> label {
padding: em(11) 0;
line-height: em(16);
}
2014-04-06 14:14:03 +00:00
> .field_with_errors {
2014-04-06 14:14:03 +00:00
input,
textarea {
border: $input-border-width solid $flash-error;
2014-04-06 14:14:03 +00:00
&:hover,
&:focus {
border-color: $flash-error;
}
2014-04-06 14:14:03 +00:00
&:focus {
color: $input-text;
}
}
}
2014-04-06 14:14:03 +00:00
.select-wrapper {
$select-padding: em(4);
background-color: $input-primary;
border: $input-border-colour solid $input-border-width;
position: relative;
display: inline-block;
margin-right: em(10);
select {
@include appearance(none);
font-size: $input-font-size;
font-family: $open-sans;
float: left;
display: block;
width: auto;
position: relative;
margin-left: 0;
border: 0;
padding: $select-padding em(45) $select-padding $input-padding;
font-size: $input-font-size;
option {
font-size: $input-font-size;
}
&:focus {
outline: none;
}
}
&:after {
font-family: $fontawesome;
pointer-events: none;
content: $fa-var-chevron-down;
font-weight: normal;
font-style: normal;
position: absolute;
top: em(5);
right: $input-padding;
padding-left: $input-padding;
border-left: em(1) solid lighten($input-secondary, 20%);
}
&:hover {
border: $input-border-width solid lighten($input-secondary, 20%);
}
&:focus {
border: $input-border-width solid $input-secondary;
color: $input-secondary;
background: transparent;
}
}
input[type=text],
input[type=password],
input[type=email],
textarea {
background-color: $input-primary;
color: $input-text;
font-size: $input-font-size;
padding: $input-padding;
height: em(40);
border: $input-border-colour solid $input-border-width;
&:hover {
border: $input-border-width solid lighten($input-secondary, 20%);
}
&:focus {
border: $input-border-width solid $input-secondary;
color: $input-secondary;
outline: none;
background: transparent;
}
}
input[type=checkbox] {
@include appearance(none);
width: em(40);
height: em(40);
font-size: $input-font-size;
padding: $input-padding;
background-color: $input-primary;
border: $input-border-colour solid $input-border-width;
position: relative;
margin: 0;
float: left;
&:focus {
outline: none;
}
&:hover {
border: $input-border-width solid lighten($input-secondary, 20%);
cursor: pointer;
}
&:checked {
border-color: $button-secondary;
&:after {
content: $fa-var-check;
pointer-events: none;
font-family: $fontawesome;
font-weight: normal;
font-style: normal;
position: absolute;
font-size: em(22);
top: em(4);
left: em(5);
color: $button-secondary;
}
}
}
textarea {
height: auto;
width: 100%;
}
2014-04-06 14:14:03 +00:00
}
.controls {
margin-bottom: em(20);
button,
input[type=submit] {
@include button($button-secondary);
margin-bottom: 0;
outline: none;
}
}
}
2014-04-06 14:14:03 +00:00
form.dark {
.fields {
2014-04-06 14:14:03 +00:00
input {
color: white;
background: $input-dark-background-colour;
border: $input-dark-border-colour solid $input-dark-border-width;
2014-04-06 14:14:03 +00:00
&:hover {
border: $input-dark-border-width solid $input-dark-border-hover-colour;
2014-04-06 14:14:03 +00:00
}
&:focus {
border: $input-dark-border-width solid $input-dark-border-focus-colour;
}
&:-webkit-autofill {
-webkit-text-fill-color: white !important;
-webkit-box-shadow: 0 0 0px 1000px $input-dark-background-colour inset;
2014-04-06 14:14:03 +00:00
}
}
}
.controls {
margin-bottom: 20px;
2014-04-06 14:14:03 +00:00
button,
input {
background-color: $purple;
2014-04-06 14:14:03 +00:00
}
}
}
2014-04-06 14:14:03 +00:00
form.square {
@include span-columns(12);
margin: em(20) 0;
.horizontal {
@include span-columns(12);
margin-bottom: em(20);
&.small {
@include span-columns(6);
}
2014-04-06 14:14:03 +00:00
&.medium {
@include span-columns(9);
}
2014-04-06 14:14:03 +00:00
&.large {
@include span-columns(12);
}
> .field_with_errors:first-child,
> label,
> .label {
@include span-columns(3);
padding: em(11) 0;
line-height: em(16);
}
.inputs,
input[type=text],
input[type=password],
input[type=email],
textarea {
@include span-columns(9);
}
}
.controls {
@include span-columns(9);
@include shift(3);
2014-04-06 14:14:03 +00:00
}
}
2014-04-13 11:16:51 +00:00
form.search {
.query {
@include span-columns(9);
input {
width: 100%;
}
}
.controls {
@include span-columns(3);
@include shift(0);
@include omega;
input {
width: 100%;
}
}
}