mplp / docassemble-mlhframework

A docassemble extension.
Other
0 stars 0 forks source link

Adjust styling for 2nd-level headers #53

Closed ekressmiller closed 9 months ago

ekressmiller commented 10 months ago

As I understand it, if we want to use text enhancements to delineate headings, we should also apply header tags so screen readers can access the information in a similar way. It looks like the "Questions" are tagged as H1 (but "class" set to h3). When I set the headings within my subquestion to H2, they come out bigger than the question. Need to adjust them to be smaller than H1. Could probably even be normal font size but bold?

Appearance on screen of H1 question and H2 subheadings (in the subquestion) image

Inspect info for Question: image

BryceStevenWilley commented 10 months ago

Yep, unfortunately it's a known issue. The solution is to manually set the header class: https://suffolklitlab.org/docassemble-AssemblyLine-documentation/docs/coding_style_guide/accessibility#header-sizes.

I might be able to change our styles so all of the header sizes are one size smaller than the currently are, if that's doable I'll make the change.

BryceStevenWilley commented 10 months ago

We've got a few different independent choices that could work pretty well here.

Choice 1:

Choice 2:

Note that either choice doesn't really change the size of the headers on mobile, there they intelligently scale to not take up the whole screen (they are a bit hard to distinguish from each other there, but they are still clearly distinguished from paragraph text).

The code is all in https://github.com/mplp/docassemble-mlhframework/tree/header_sizes


Example of smaller and bolder: Screenshot from 2023-12-22 16-43-31


Example of larger and normal weight: Screenshot from 2023-12-26 10-19-07


For comparison, this is what that screen looks like now:

Screenshot from 2023-12-22 16-43-43

ekressmiller commented 9 months ago

Thanks Bryce! For Choice 1, I'd prefer making H2s a little smaller than H1. I think H2s will be the most fine-grained subheading we use in most cases so making that distinction feels useful. For Choice 2, I think I slightly prefer the "larger and normal weight" option. Feels slightly easier on the eyes.