/// /// Paradigm Shift by HTML5 UP /// html5up.net | @ajlkn /// Free for personal and commercial use under the CCA 3.0 license (html5up.net/license) /// /* Form */ form { margin: 0 0 _size(element-margin) 0; > :last-child { margin-bottom: 0; } > .fields { $gutter: _size(form-gutter); @include vendor('display', 'flex'); @include vendor('flex-wrap', 'wrap'); margin: ($gutter * -1) 0 _size(element-margin) ($gutter * -1); width: calc(100% + #{$gutter * 2}); > .field { @include vendor('flex-grow', '0'); @include vendor('flex-shrink', '0'); padding: $gutter 0 0 $gutter; width: calc(100% - #{$gutter * 1}); > :last-child { margin-bottom: 0; } &.half { width: calc(50% - #{$gutter * 0.5}); } &.third { width: calc(#{100% / 3} - #{$gutter * (1 / 3)}); } &.quarter { width: calc(25% - #{$gutter * 0.25}); } } } @include breakpoint('<=xsmall') { > .fields { $gutter: (_size(element-margin) * 0.75); margin: ($gutter * -1) 0 _size(element-margin) ($gutter * -1); width: calc(100% + #{$gutter * 2}); > .field { padding: $gutter 0 0 $gutter; width: calc(100% - #{$gutter * 1}); &.half { width: calc(100% - #{$gutter * 1}); } &.third { width: calc(100% - #{$gutter * 1}); } &.quarter { width: calc(100% - #{$gutter * 1}); } } } } } input[type="text"], input[type="password"], input[type="email"], input[type="tel"], input[type="search"], input[type="url"], select, textarea { @include vendor('appearance', 'none'); border-radius: _size(border-radius); border: solid 2px _palette(border); color: inherit; display: block; outline: 0; padding: 0 1rem; text-decoration: none; width: 100%; &:invalid { box-shadow: none; } &:focus { border-color: _palette(accent-alt); } } label { color: _palette(fg-bold); display: block; font-family: _font(family-heading); font-size: 0.75rem; font-weight: _font(weight-heading-light); letter-spacing: _font(kerning-heading); line-height: 1.75; margin: 0 0 (_size(element-margin) * 0.5) 0; text-transform: uppercase; } input[type="text"], input[type="password"], input[type="email"], input[type="tel"], input[type="search"], input[type="url"] { height: _size(element-height); } select { background-image: svg-url(""); background-position: calc(100% - 1rem) center; background-repeat: no-repeat; background-size: 1.25rem; height: _size(element-height); padding-right: _size(element-height); text-overflow: ellipsis; option { background-color: _palette(bg); color: _palette(fg); } &:focus { &::-ms-value { background-color: transparent; } } &::-ms-expand { display: none; } } textarea { padding: 0.75rem 1rem; } input[type="checkbox"], input[type="radio"], { @include vendor('appearance', 'none'); display: block; float: left; margin-right: -2rem; opacity: 0; width: 1rem; z-index: -1; & + label { @include icon(false, solid); color: _palette(fg); cursor: pointer; display: inline-block; font-family: _font(family); font-size: 1rem; font-weight: _font(weight); letter-spacing: _font(kerning); padding-left: (_size(element-height) * 0.6) + 0.875rem; padding-right: 0.875rem; position: relative; text-transform: none; &:before { border-radius: _size(border-radius); border: solid 2px _palette(border); content: ''; display: inline-block; font-size: 0.8rem; height: (_size(element-height) * 0.75); left: 0; line-height: (_size(element-height) * 0.75); position: absolute; text-align: center; top: (_size(element-height) * -0.05); width: (_size(element-height) * 0.75); } } &:checked + label { &:before { content: '\f00c'; background-color: _palette(accent); border-color: _palette(accent); color: _palette(bg); } } &:focus + label { &:before { border-color: _palette(accent); box-shadow: 0 0 0 1px _palette(accent); } } } input[type="checkbox"] { & + label { &:before { border-radius: _size(border-radius); } } } input[type="radio"] { & + label { &:before { border-radius: 100%; } } } ::-webkit-input-placeholder { opacity: 1.0; color: _palette(fg-light) !important; } :-moz-placeholder { opacity: 1.0; color: _palette(fg-light) !important; } ::-moz-placeholder { opacity: 1.0; color: _palette(fg-light) !important; } :-ms-input-placeholder { opacity: 1.0; color: _palette(fg-light) !important; } @include breakpoint('<=small') { label { font-size: 0.675rem; } input[type="checkbox"], input[type="radio"] { & + label { font-size: 1rem; } } } @include breakpoint('<=xxsmall') { label { font-size: 0.675rem; } input[type="checkbox"], input[type="radio"] { & + label { font-size: 1rem; } } }