cssremedy icon indicating copy to clipboard operation
cssremedy copied to clipboard

Consistent and reliable form styles

Open scottkellum opened this issue 5 years ago • 7 comments

Form consistency and styling is one of the biggest hurdles I face when working. The box model, sizing, and font settings don’t inherit reliably. Attempts at normalizing forms often require vendor specific CSS.

I’d personally like to see the w3c take this on to create some standards in how form components should be styled, but it seems relevant to this project to remedy some of these issues. I’m curious how others work through these issues and what foundational styles you all find helpful.

scottkellum avatar Mar 14 '19 20:03 scottkellum

Probably want to track progress (I encourage engagement) in https://github.com/WICG/form-controls-components 🎉

Malvoz avatar Jul 17 '19 16:07 Malvoz

I definitely want to do this. Maybe in a separate style sheet, so it's easy to see.

I've started digging into best practices for form styling, given the current state of CSS.

Checkbox styling: https://codepen.io/jensimmons/pen/KKPzxJa

Radio button styling: https://codepen.io/jensimmons/pen/JjPXeqN

Text-area styling: https://codepen.io/jensimmons/pen/dybXYOp

jensimmons avatar Sep 15 '19 02:09 jensimmons

I know that Google & Microsoft are working on this already – and I think they are looking for input? I wonder if @stubbornella can speak to that more.

mirisuzanne avatar Sep 15 '19 02:09 mirisuzanne

Greg Witworth has been taking the lead on this. I can tell you more in person, Mia.

jensimmons avatar Sep 15 '19 04:09 jensimmons

oh right - I remember his article on it (which also seems like relevant context here).

mirisuzanne avatar Sep 15 '19 04:09 mirisuzanne

Adrian Roselli shared some thoughts recently suggesting text inputs and textareas ought to inherit additional text properties.

ollicle avatar Sep 15 '19 09:09 ollicle

@mirisuzanne, that's right. @gregwhitworth and I are working together on this. Right now the goals are mainly a11y and a design refresh, but ultimately we'd both like to make things more styleable too.

So far, we've been researching tons of design systems and browsers to understand styles that reflect designer's choices. If there are styles in this project that I should look at too, please point me in the right direction. (@jensimmons I'd been hoping to talk more about this at tpac, but the travel didn't work out).

Fwiw, I don't think one standardized set of styles would work because they might not translate to new devices... e.g. what should a date input look like on a watch? tv? refrigerator? Some new thing we haven't thought up yet? I wouldn't feel comfortable trying to nail that down because folks keep inventing new, cool devices I never would have thought of... I would love to make them styleable though. That would add future flexibility and make remedies like this more powerful. And new devices easier to make webby.

stubbornella avatar Sep 16 '19 07:09 stubbornella