Here’s how to customize your Image upload / File upload input.
For example you can style it like this:
To add this to your Knack app:
/* Add this to your CSS */
/* Restyles file input */
/* Note: Replace field_XXX with your own */
#field_123_upload {
border: 1px dashed blue;
background-color: #f8f8f8;
cursor: pointer;
padding-bottom: 100px;
padding-left: 90px;
padding-right: 40px;
padding-top: 24px;
width: 300px;
}
#field_123_upload:before {
content: "Drop file here or click to upload";
font-size: 1.1em;
font-weight: 500;
color: black;
margin-bottom: 20px;
margin-left: -56px;
}
/* Removes "no file uploaded" text because otherwise it stays on screen when the user drags-and-drops a file */
input[type="file"] {
color: transparent;
}
Or…
To style all the file inputs in your app use this version instead:
/* Add this to your CSS */
/* Restyles all file inputs */
.kn-file-upload input.is-file {
border: 1px dashed blue;
background-color: #f8f8f8;
cursor: pointer;
padding-bottom: 100px;
padding-left: 90px;
padding-right: 40px;
padding-top: 24px;
width: 300px;
}
.kn-file-upload input.is-file:before {
content: "Drop file here or click to upload";
font-size: 1.1em;
font-weight: 500;
color: black;
margin-bottom: 20px;
margin-left: -56px;
}
/* Removes "no file uploaded" text because otherwise it stays on screen when the user drags-and-drops a file */
input[type="file"] {
color: transparent;
}
Enjoy,
Ian
Knack Pros