Skip to content

Instantly share code, notes, and snippets.

@plapier
Created April 24, 2011 03:52
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save plapier/939284 to your computer and use it in GitHub Desktop.
Save plapier/939284 to your computer and use it in GitHub Desktop.
Style file-inputs in webkit browsers only.
// Style file-upload for webkit-based browsers
@media screen and (-webkit-min-device-pixel-ratio:0) {
input[type="file"] {
background: #fff;
border: 1px solid $tan;
@include border-radius(0 2px 2px 0);
@include box-sizing(border-box);
color: #666;
font-size: 14px;
height: 32px;
@include linear-gradient(#ffffe8, white);
margin-left: 77px;
padding: 4px 15px;
position: relative;
text-indent: -200px;
width: 500px;
@include transition;
&::before {
@include border-radius(2px 0 0 2px);
border: 1px solid $tan-dark;
@include box-sizing(border-box);
color: #FFF;
content: 'Select File';
display: block;
font-size: 14px;
font-weight: bold;
height: 32px;
left: -78px;
@include linear-gradient(#F3BC00, #E0A002);
padding: 9px 10px;
position: absolute;
text-align: center;
text-indent: 0;
text-shadow: #333 1px 1px 1px;
@include title-font;
top: -1px;
@include transition;
width: 100px;
}
&:focus, &:hover {
border: 1px solid $tan-dark;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment