barebones/assets/sass/base/_forms.scss

123 lines
2.1 KiB
SCSS
Raw Normal View History

2015-04-01 18:32:10 +02:00
/**
* Blanket input styles for normalisation
*/
2015-10-15 18:24:32 +02:00
*:focus {
outline: 0;
}
2015-04-01 18:32:10 +02:00
input,
select,
textarea {
2015-10-15 18:24:32 +02:00
background-color: $base-background-colour;
border: solid 1px $base-colour;
border-radius: 0;
color: $base-colour;
line-height: ($base-spacing-unit * 1.5);
height: ($base-spacing-unit * 1.5);
padding: 0 ($base-spacing-unit / 2);
width: 100%;
2015-04-01 18:32:10 +02:00
}
input[type="checkbox"],
input[type="radio"] {
2015-10-15 18:24:32 +02:00
background: transparent;
border: 0;
line-height: normal;
height: auto;
width: auto;
2015-04-01 18:32:10 +02:00
}
input[type="file"] {
2015-10-15 18:24:32 +02:00
line-height: normal;
height: auto;
padding: ($base-spacing-unit / 4) ($base-spacing-unit / 2);
}
input[type="submit"] {
-webkit-border-radius: 0;
border-radius: 0;
2015-04-01 18:32:10 +02:00
}
input[disabled] {
2015-10-15 18:24:32 +02:00
background-color: whitesmoke;
cursor: not-allowed;
2015-04-01 18:32:10 +02:00
}
select {
2015-10-15 18:24:32 +02:00
line-height: normal;
padding: 0;
padding-left: ($base-spacing-unit / 2);
2015-04-01 18:32:10 +02:00
}
textarea {
2015-10-15 18:24:32 +02:00
min-height: ($base-spacing-unit * 4);
overflow: auto;
vertical-align: top;
resize: vertical;
2015-04-01 18:32:10 +02:00
}
/**
* Form utility classes
*/
2015-04-09 17:10:07 +02:00
.form--inline {
2015-10-15 18:24:32 +02:00
.form__group {
display: inline-block;
}
2015-04-09 17:10:07 +02:00
}
2015-04-01 18:32:10 +02:00
.checkbox,
.radio {
2015-10-15 18:24:32 +02:00
display: block;
padding-left: $base-spacing-unit;
&.inline {
display: inline-block;
}
> input {
float: left;
margin-left: -($base-spacing-unit);
margin-top: 4px;
}
2015-04-01 18:32:10 +02:00
}
.form__group {
2015-10-15 18:24:32 +02:00
display: block;
margin-bottom: $base-spacing-unit;
2015-04-01 18:32:10 +02:00
}
.form__label {
2015-10-15 18:24:32 +02:00
display: block;
margin-bottom: ($base-spacing-unit / 2);
2015-04-01 18:32:10 +02:00
}
/**
* Input Group
*
* Allows for prepend/append of elements
* (such as icons) on an input.
*/
.input-group {
2015-10-15 18:24:32 +02:00
position: relative;
> input {
padding: 0 ($base-spacing-unit * 2);
2015-04-01 18:32:10 +02:00
}
2015-10-15 18:24:32 +02:00
.input-group__addon {
line-height: ($base-spacing-unit * 1.5);
height: ($base-spacing-unit * 1.5);
position: absolute;
text-align: center;
top: 0;
width: ($base-spacing-unit * 1.5);
&:first-child {
left: 0;
}
&:last-child {
right: 0;
}
2015-04-01 18:32:10 +02:00
}
}