Andy-set-studio / boilerform

Boilerform is a little HTML and CSS boilerplate to take the pain away from working with forms.
https://boilerform.hankchizljaw.com
MIT License
712 stars 35 forks source link

Add support for file input #10

Open AucT opened 6 years ago

AucT commented 6 years ago

Add support for file input

Andy-set-studio commented 6 years ago

Good shout, @nchan0154!

nchan0154 commented 6 years ago

What would an ideal solution look like to you? Typically I would style it the same as how other buttons are styled.

Andy-set-studio commented 6 years ago

I think that's a good call @nchan0154. I think that we'd want to replicate the 'no file chosen' label/status too.

The "File Browser" on WTF forms is decent, but the state doesn't change when a file is added.

tcaruth commented 6 years ago

WTF, forms? is only css. To my knowledge, the filename can't be put in a custom element without javascript.

Andy-set-studio commented 6 years ago

Yeh I thought that might be the case and it’s something I’m not averse to. We’ve already got modular setup with the JavaScript, so we could add some progressive enhancements where needed.

The label’s visibility could be based on the <html> element having a js class, or not having a no-js class.