/* Form */ form { margin: 0 0 _size(element-margin) 0; } 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: none; border: solid 1px; color: inherit; display: block; outline: 0; padding: 0 1rem; text-decoration: none; width: 100%; &:invalid { box-shadow: none; } } label { display: block; font-size: 1rem; font-weight: _font(weight-bold); margin: 0 0 (_size(element-margin) * 0.5) 0; } input[type="text"], input[type="password"], input[type="email"], input[type="tel"], input[type="search"], input[type="url"] { height: _size(element-height); } select { background-size: 1.25rem; background-repeat: no-repeat; background-position: calc(100% - 1rem) center; height: _size(element-height); padding-right: _size(element-height); text-overflow: ellipsis; &: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; cursor: pointer; display: inline-block; font-size: 1rem; font-weight: _font(weight); padding-left: (_size(element-height) * 0.6) + 0.875rem; padding-right: 0.875rem; position: relative; &:before { border-radius: _size(border-radius); border: solid 1px; content: ''; display: inline-block; height: (_size(element-height) * 0.6); left: 0; line-height: (_size(element-height) * 0.575); position: absolute; text-align: center; top: (_size(element-height) * -0.05); width: (_size(element-height) * 0.6); } } &:checked + label { &:before { content: '\f00c'; } } } input[type="checkbox"] { & + label { &:before { border-radius: _size(border-radius); } } } input[type="radio"] { & + label { &:before { border-radius: 100%; } } } ::-webkit-input-placeholder { opacity: 1.0; } :-moz-placeholder { opacity: 1.0; } ::-moz-placeholder { opacity: 1.0; } :-ms-input-placeholder { opacity: 1.0; } @mixin color-form($p: null) { $highlight: _palette($p, highlight); label { color: _palette($p, fg-bold); } input[type="text"], input[type="password"], input[type="email"], input[type="tel"], input[type="search"], input[type="url"], select, textarea { background-color: _palette($p, border-bg); border-color: _palette($p, border); &:focus { @if $p == $highlight { border-color: _palette($p, fg-bold); box-shadow: 0 0 0 1px _palette($p, fg-bold); } @else { border-color: _palette(accent1, bg); box-shadow: 0 0 0 1px _palette(accent1, bg); } } } select { background-image: svg-url(""); option { color: _palette($p, fg); background-color: _palette($p, bg); } } input[type="checkbox"], input[type="radio"], { & + label { color: _palette($p, fg); &:before { background: _palette($p, border-bg); border-color: _palette($p, border); } } &:checked + label { &:before { @if $p == $highlight { background-color: _palette($p, fg-bold); border-color: _palette($p, fg-bold); color: _palette($p, bg); } @else { background-color: _palette(accent1, bg); border-color: _palette(accent1, bg); color: _palette(accent1, fg-bold); } } } &:focus + label { &:before { @if $p == $highlight { border-color: _palette($p, fg-bold); box-shadow: 0 0 0 1px _palette($p, fg-bold); } @else { border-color: _palette(accent1, bg); box-shadow: 0 0 0 1px _palette(accent1, bg); } } } } ::-webkit-input-placeholder { color: _palette($p, fg-light) !important; } :-moz-placeholder { color: _palette($p, fg-light) !important; } ::-moz-placeholder { color: _palette($p, fg-light) !important; } :-ms-input-placeholder { color: _palette($p, fg-light) !important; } } @include color-form;