JSFiddle - React, Tailwind, and code Playground
by farhatdz
HTML
<input type="file" name="file" id="file" class="inputfile" />
<!--<label for="file">Choose a file</label>-->
<label for="file"><strong>Choose a file</strong></label>
CSS
.inputfile {
width: 0.1px;
height: 0.1px;
opacity: 0;
overflow: hidden;
position: absolute;
z-index: -1;
}
.inputfile + label {
font-size: 1.25em;
font-weight: 700;
color: white;
background-color: black;
display: inline-block;
}
.inputfile:focus + label,
.inputfile + label:hover {
background-color: red;
}
.inputfile + label {
cursor: pointer; /* "hand" cursor */
}
.inputfile:focus + label {
outline: 1px dotted #000;
outline: -webkit-focus-ring-color auto 5px;
}
.inputfile + label * {
pointer-events: none;
}