Skip to content

Instantly share code, notes, and snippets.

@ivancuric
Last active October 12, 2018 10:28
Show Gist options
  • Save ivancuric/b82c8bed34e0537ca5670c057c4ad143 to your computer and use it in GitHub Desktop.
Save ivancuric/b82c8bed34e0537ca5670c057c4ad143 to your computer and use it in GitHub Desktop.
/** Extends sanitize.css */
// input styling
button,
input,
label,
select,
textarea {
display: block;
border-style: none;
background-color: transparent;
color: currentColor;
text-transform: inherit;
font-family: inherit;
line-height: inherit;
appearance: none;
margin: 0;
border-radius: 0;
}
::-webkit-file-upload-button {
font-family: inherit;
line-height: inherit;
-webkit-appearance: button;
}
// prevent events propagating to children
a,
button,
label {
> * {
pointer-events: none;
}
}
button {
box-shadow: none;
user-select: none;
}
input {
-webkit-border-radius: 0; // iOS 8+
cursor: auto;
&[type='search'] {
appearance: none;
}
}
select {
&::-ms-expand {
display: none; // Edge 12+, Internet Explorer 11-
}
&::-ms-value {
color: currentColor; // Edge 12+, Internet Explorer 11-
}
}
fieldset {
margin: 0;
padding: 0;
border: 0;
}
:invalid {
box-shadow: none;
}
::-ms-clear {
display: none;
}
:-moz-submit-invalid {
box-shadow: none;
}
:-moz-ui-invalid {
box-shadow: none;
}
::-webkit-inner-spin-button,
::-webkit-outer-spin-button {
margin: 0;
-webkit-appearance: none;
}
[aria-busy='true'] {
cursor: progress;
}
[aria-controls] {
cursor: pointer;
}
[aria-disabled],
[disabled] {
cursor: default;
}
[tabindex='-1']:focus {
outline: none;
}
[type='hidden'] {
display: none;
}
[hidden] {
&[aria-hidden='false'] {
@include sr-only;
}
}
button:focus,
a:focus,
a:active,
button::-moz-focus-inner,
input[type='reset']::-moz-focus-inner,
input[type='button']::-moz-focus-inner,
input[type='submit']::-moz-focus-inner,
select::-moz-focus-inner,
input[type='file'] > input[type='button']::-moz-focus-inner {
outline: none !important;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment