RockefellerArchiveCenter / styles

Style Library for the Rockefeller Archive Center
https://styles.rockarch.org
MIT License
0 stars 1 forks source link

Adds input styles #80

Closed helrond closed 3 years ago

helrond commented 3 years ago

Adds styles for checkboxes, selects, text and textarea inputs.

Along with other general review, a couple of things came up when pulling this together:

fixes #58 fixes #65 fixes #69

HaSistrunk commented 3 years ago
  1. custom select: I was just reading this article on native v. custom select inputs by Sarah Higley, which is useful context and I think this may be an important guiding thought:

While pure aesthetic preference is a common reason to roll a custom select component, it is not a good reason. Accessibility and usability should drive aesthetic choices, not the reverse. So many accessibility tradeoffs are involved in a custom solution that there must be a correspondingly strong reason to need one; “it should look prettier” just ain’t it.

  1. I would vote yes, let's standardize labels stacking on top of inputs. I'm not sure about taking up the full width of the parent element by default, though. The selects and checkboxes don't generally do this in our implementation, right?
HaSistrunk commented 3 years ago

One other thing:

helrond commented 3 years ago

Hold on I still need to do the thing with labels.

helrond commented 3 years ago

OK, so in 001f82b I have added a width of 100% to selects, inputs, and textareas. This means that the labels will sit on top of those inputs, BUT it also means that the inputs will expand to fill the full width of their parent element. I think this will likely require some HTML changes in existing sites, and may not be as flexible as we'd like (for example if we want inline forms), but a more flexible approach would (I think) require a wrapping div.

bonniegee commented 3 years ago

Not sure if other folks think this is an issue, but the text seems to be slightly lower than the checkboxes in the grouped checkboxes:

Screen Shot 2021-07-20 at 17 00 48
helrond commented 3 years ago

Grrr, the joys and perils of flexbox.

I'm struggling a little bit with this checkbox group because, as far as I know, we don't actually have this implemented anywhere, so it feels weird to make this "look right" in isolation of knowing what the actual application is.

HaSistrunk commented 3 years ago

Yeah. Actually, you prompted me to wonder if we should be using fieldset groupings for the dimes filters: image

Maybe that's a model to base this on?

helrond commented 3 years ago

OK, so what I've done here is add a wrapper to checkboxes, which improves alignment of the label and the checkbox across multiple layouts. As per @HaSistrunk's suggestion, I've also styled the fieldset element so it more closely matches the facets in DIMES.

HaSistrunk commented 3 years ago

Awesome.

And regarding the width of 100% on selects, inputs, and textareas, I'm good with that although I admit I don't have a good sense yet of how much we'll have to change existing sites when we implement, and if the lack of flexibility is going to be a barrier.