sass-site/source/assets/stylesheets/foundation/_forms.scss
₍˄ุ.͡˳̫.˄ุ₎ b247d93be9 Stuffs
2013-10-12 11:51:13 -04:00

119 lines
2.2 KiB
SCSS

form,
fieldset {
@extend %reset-margin;
@extend %reset-padding;
}
fieldset { @extend %reset-border; }
label {
@extend %bold-elements;
@include padding-leader;
display: inline-block;
}
input,
%button {
@extend %reset-margin;
font: {
size: inherit;
family: inherit;
}
line-height: normal;
background-image: none;
&::-moz-focus-inner {
border: 0;
padding: 0;
}
}
input[type="text"],
%button {
@include rhythm-borders(1px, .5);
display: block;
border: {
color: $color-border;
radius: $border-radius;
}
padding: {
right: $gutter-width;
left: $gutter-width;
}
width: 100%;
vertical-align: middle;
@include breakpoint($mobile-large) {
display: inline-block;
width: auto;
}
}
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);
white-space: nowrap;
background: $color-background-shade;
vertical-align: middle;
cursor: pointer;
text-align: center;
&,
&: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;
}
}
button {
@extend %button;
-webkit-appearance: button;
text-transform: none;
}
%tab-focus {
outline: thin dotted $color-text;
outline: 5px auto -webkit-focus-ring-color {
offset: -2px;
}
}