bloom-works / guides-template

Placeholder repo for work on Bloom Guides
https://bloom-guides-template.netlify.app/
MIT License
2 stars 0 forks source link

Components: Tables #19

Closed jrubenoff closed 1 year ago

jrubenoff commented 1 year ago

cc: @jeffmaher

Stories

Notes

Done When

jrubenoff commented 1 year ago

A note

Tables are really important for the OPO report. They're the best format for content like Section 10's appendices:

CleanShot 2023-06-14 at 10 09 30@2x

By contrast, the table body in Section 1 of the playbook contains a single row of bulleted lists. They're very hard to read with our current typography style.

CleanShot 2023-06-14 at 10 10 04@2x

I'd highly recommend replacing this table with a series of headers and bulleted lists.

CleanShot 2023-06-14 at 10 11 36@2x

Perhaps we could use the Grid component (#15 or #16) to save space.

Design challenges with tables

They're very hard to read on smaller screens.

The "Responsive table patterns" section of this comment concisely summarizes of the pros and cons of different approaches. (Also see the Tablesaw plugin docs.)

It's easy to get overwhelmed here, so I constrained myself by designing for the tables we currently have, rather than whatever tables we plan to add in the future.

The OPO report's tables contain:

It doesn't seem like readers on small screens would benefit from a ton of interactivity here. They don't need to compare data across rows or columns. They just need the content to be legible.

So I've collapsed each row on smaller screens like so:

CleanShot 2023-06-14 at 10 12 55@2x

On larger screens, I made the table header sticky so readers can easily see their context.

CleanShot 2023-06-14 at 10 13 41

The styles for the sticky header target <th> elements. We can add documentation encouraging the Bloom staff to use something like this tables generator, which will ensure Markdown outputs semantic markup here.

Status

I've committed an example to the storybook branch. I can open a PR with just the table styles once #5 and #6 are done.


@jeffmaher @SMakaiTakori Let me know if you have any comments or questions!

SMakaiTakori commented 1 year ago

@jrubenoff Thanks for your hard work on this! I like the idea of collapsing the table rows for smaller screens, it makes the content more readable.

For the larger screen design, I am thinking the sticky header could be an accessibility issue, because animations can be dizzying/nausea/distracting where we might just want to add a button at the bottom of the page to scroll back to the top of the page, but I would like to hear what @admoorgit and @jeffmaher think.