JSFiddle - React, Tailwind, and code Playground
CSS
/* Styling a file input
* @author: James Wakefield
* @url: http://jameswakefield.eu
*/
input[type="file"] {
border: 1px solid #333;
box-sizing: border-box;
display: inline-block;
font-size: 14px;
margin: 0;
padding: 8px;
position: relative;
background-color: #fff;
overflow: hidden;
width: 100%;
-webkit-appearance: none;
-webkit-box-sizing: border-box;
z-index: 1;
}
input[type="file"]:after { /* Mask the no file chosen label */
background-color: #fff;
content: '';
display: block;
height: 100%;
position: absolute;
top: 0;
left: 0;
width: 100%;
z-index: 10;
}
input[type="file"]::-webkit-file-upload-button { /* Style the button */
background: #fff;
color: #555;
font: inherit;
padding: 0;
position: relative;
border: none;
text-align: left;
position: relative;
z-index: 100;
-webkit-appearance: none;
}