sass-site/source/assets/stylesheets/foundation/_forms.scss

116 lines
2.2 KiB
SCSS
Raw Normal View History

2013-10-09 12:30:53 +02:00
form,
fieldset {
@extend %reset-margin;
@extend %reset-padding;
}
2013-10-09 12:30:53 +02:00
fieldset { @extend %reset-border; }
2013-10-09 12:30:53 +02:00
label {
@extend %bold-elements;
@include padding-leader;
display: inline-block;
}
input,
2013-10-09 12:30:53 +02:00
button {
@extend %reset-margin;
font: {
size: inherit;
family: inherit;
}
line-height: normal;
background-image: none;
2013-10-09 12:30:53 +02:00
&::-moz-focus-inner {
border: 0;
padding: 0;
}
}
2013-02-09 04:10:33 +01:00
2013-10-09 12:30:53 +02:00
input[type="text"],
button {
@include rhythm-borders(1px, .44);
display: block;
border: {
color: $color-border;
radius: $border-radius;
}
padding: {
right: $gutter-width;
left: $gutter-width;
}
width: 100%;
vertical-align: middle;
@include at-breakpoint($mobile-large) {
@include padding-leader(.15);
@include padding-trailer(.125);
display: inline-block;
width: auto;
}
}
2013-02-09 04:10:33 +01:00
2013-10-09 12:30:53 +02:00
input {
&[type="text"] {
@each $placeholder in "-moz", ":-moz", "-ms", ":-webkit" {
&:#{$placeholder}-placeholder { color: $color-text-weak; }
}
@include box-shadow(0 1px 1px $color-shadow inset);
@include transition(color-border ease-in-out 0.15s, box-shadow ease-in-out 0.15s);
&:focus {
@include box-shadow(inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(red($color-accent), green($color-accent), blue($color-accent), 0.6));
color-border: $color-accent;
outline: 0;
background: $color-background;
}
}
&[type="radio"],
&[type="checkbox"] {
@extend %tab-focus;
box-sizing: border-box;
margin: 4px 0 0 {
top: 1px \9;
}
line-height: normal;
}
}
button {
@extend %bold-elements;
@include box-shadow(0 2px 1px $color-shadow);
-webkit-appearance: button;
text-transform: none;
text-align: center;
white-space: nowrap;
background: $color-background-shade;
cursor: pointer;
&,
&:hover,
&:focus { color: $color-text-strong; }
&:hover,
&:focus {
background: lighten(mix($color-background-shade, $color-accent), 25);
}
&:focus { @extend %tab-focus; }
&:active,
&.active {
@include box-shadow(inset 0 3px 5px $color-shadow);
outline: 0;
}
}
%tab-focus {
outline: thin dotted $color-text;
outline: 5px auto -webkit-focus-ring-color {
offset: -2px;
}
}