Skip to content

Instantly share code, notes, and snippets.

@dwarfmondo
Forked from nathansmith/1_form-reset.scss
Created January 12, 2012 15:57
Show Gist options
  • Save dwarfmondo/1601256 to your computer and use it in GitHub Desktop.
Save dwarfmondo/1601256 to your computer and use it in GitHub Desktop.
Remove all visual style from form fields
// Note: This file is dependent on Sass and Compass.
// Sass = http://sass-lang.com
// Compass = http://compass-style.org
@import compass/css3
// `Form Element Reset.
//----------------------------------------------------------------------------------------------------
::-moz-focus-inner
border: 0
padding: 0
input[type="search"]::-webkit-search-decoration
display: none
input,
button,
select,
textarea
margin: 0
outline: 0
vertical-align: middle
button,
input[type="reset"],
input[type="submit"],
input[type="button"]
-webkit-appearance: none
+background-clip(padding-box)
+border-radius(0)
background: none
border: 0
cursor: pointer
// Helvetica Neue present, because it works better
// for line-height on buttons than Arial, on OS X.
font: 13px/1.3 'Helvetica Neue', Arial, 'Liberation Sans', FreeSans, sans-serif
overflow: visible
padding: 0
width: auto
textarea,
select,
input[type="date"],
input[type="datetime"],
input[type="datetime-local"],
input[type="email"],
input[type="month"],
input[type="number"],
input[type="password"],
input[type="search"],
input[type="tel"],
input[type="text"],
input[type="time"],
input[type="url"],
input[type="week"]
+box-sizing(border-box)
+background-clip(padding-box)
+border-radius(0)
-webkit-appearance: none
background: none
border: 0
outline: 0
padding: 0
text-align: left
font-size: 13px
// Leaving out Helvetica Neue, to not throw off size="..."
// on inputs. Arial is more reliable, on Windows and OS X.
font-family: Arial, 'Liberation Sans', FreeSans, sans-serif
height: 1.8em
button[disabled],
input[disabled],
select[disabled],
select[disabled] option,
select[disabled] optgroup,
textarea[disabled]
-moz-user-select: -moz-none
-webkit-user-select: none
-khtml-user-select: none
user-select: none
cursor: default
\:invalid
// Suppress red glow that Firefox
// adds to form fields by default,
// even when user is still typing.
+box-shadow(none)
textarea,
select[size],
select[multiple]
height: auto
// Tweaks for Safari + Chrome.
@media (-webkit-min-device-pixel-ratio: 0)
select,
select[size="0"],
select[size="1"]
height: 1.8em
textarea
min-height: 40px
overflow: auto
resize: vertical
width: 100%
optgroup
font-style: normal
font-weight: normal
// Font family repeated, for Firefox.
font-family: Arial, 'Liberation Sans', FreeSans, sans-serif
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment