Problem/Motivation
I have aging eyes. Therefore I (and many of my aging peers) set the default font size in our browser to 16px or higher. A default font size of 1em or 100% or higher honors this preference. The Bartik theme has font-size:87.5% for the body. Other CSS styles adjust this slightly, but the end result for most content is a font size that is smaller than my browser's default (15px for the main content, 12.8px in the sidebar, 12px in the footer). I can't read this content without using my browser's zoom features.
Proposed resolution
- Never hide content from low vision users by using a font size that's less than 1em.
- Change element font sizes as necessary to maintain content differentiation
- Try to keep large element font size the same as current implementation.
I believe in stylistic choice and won't recommend this for all themes, but since Seven is the default install and admin theme, I feel strongly that everyone should be able to see its content without having to know the browser zoom keystrokes (some users aren't aware of these).
Beta phase evaluation
| Issue category | Task because it's not technically a bug or a new feature. |
|---|---|
| Issue priority | Normal because it is a non-breaking issue. |
| Unfrozen changes | Unfrozen because it only changes CSS. |
| Prioritized changes | The main goal of this issue is usability/accessibility. |
| Comment | File | Size | Author |
|---|---|---|---|
| #105 | help-extend.png | 28.08 KB | njbarrett |
| #105 | panel-title-patch-#104.png | 28.19 KB | njbarrett |
| #105 | panel-title-patch-#103.png | 28.6 KB | njbarrett |
| #105 | improve_visibility_of-2045473-104.patch | 3.11 KB | njbarrett |
| #103 | improve_visibility_of-2045473-103.patch | 3.09 KB | njbarrett |
Comments
Comment #1
star-szrI think creating a patch for this could be a good task for a new contributor.
Comment #2
lauriiiChanged the body font-size to 1em
Comment #3
mgiffordThis applies nicely. The new one is the one on the left.
Comment #4
dcrocks commentedWhat is the scope here? There are many other places in Bartik's style.css where the font size is specified at less than 1em. Seven's base.css also has assigned a font-size to 'Body' that is 81.3%. Most of these are probably appropriate(tables, etc.). Is this issue just looking at 'first page', or is it intended to establish best practice?
Comment #5
dcrocks commentedActually, since I also have old eyes, I'd recommend including a similar change to the 'body' attribute in Seven's seven.base.css. Since a frequent activity with any theme is to look at the administrative menus.
Comment #6
lauriiiComment #7
internetdevels commentedAccording to comment above I've added needed styles to seven.base.css.
Comment #8
Anonymous (not verified) commented7: drupal-bartik_font_size_is_too_small-2045473-7.patch queued for re-testing.
Comment #9
mathes commentedi testet the patch and it works for me. in seven and bartik font-size is now 1em.
Comment #10
Anonymous (not verified) commentedComment #11
Anonymous (not verified) commentedEverything fine on me now for bartik.
Comment #12
mgiffordWhy would 87.5% be a good idea anyways?
I'm attaching a screenshot.
Comment #13
dcrocks commentedI wasn't sure if simplytest.me didn't do some css overrides so I tested current clone with and without the patch, as shown in the attached image(with patch on right). Note my browser default font size is set to 18px. Since seven is the default theme for install, it also has a large affect there, which some may not like. I think that should be looked at before this goes in as is.
Comment #14
mgiffordYup. This is true.
It might make more sense split this up so that it can get noticed in Seven's issue queue too.
Comment #15
dcrocks commentedI tried again with my browser set to 16px, which is the normal default. I didn't find any pages during install that scrolled now but didn't before. So I think it should be set back to RTBC. I would like to find out why Bartik and Seven assume assume that ~13px is the most desirable base font size for their themes. I found references stating this but no justification, as if it were an industry standard.
Is there a tag we could add to this to get a css designer to look at it?
Comment #16
dcrocks commentedI would like to add a reference to an article I found while researching this that I found pertinent for today's Bartik. How we learned to leave default font-size alone and embrace the em . Following this, we should delete the font-size specification, rather than modifying it.
Comment #17
star-szrFor Bartik we probably want to just remove the font-size declaration, I don't think adding
font-size: 1emis doing anything :). As for Seven, it might make more sense to leave it out of this issue as has been discussed. Seven has its own style guide and looking at this I'm thinking a vertical rhythm has been established that as far as I know would be broken if this patch were committed as is.Comment #18
star-szrComment #19
dcrocks commentedThe problem for the Seven theme is that font-size is determined relative to the parent font size while line height is determined by the current font size. I modified the line height value for Seven and I think improved things, but vertical spacing just can't be consistent with the old settings, if for no other reason than line overflows occurring differently. In the attached images, unmodified images are on the left.
Comment #20
droplet commentedPlease Read: Em vs. Percent ( http://kyleschaeffer.com/development/css-font-size-em-vs-px-vs-pt-vs/ )
Comment #21
dcrocks commentedTried the use of 100% instead of 1em but didn't see much difference, but probably should use percent any way as the original code used percent. To me, the accessibility improvement to Bartik and Seven is worth dealing with slightly taller pages. But the design elements of Seven seem to be a sticking point right now and somebody else should comment. Guess I should look at the Seven design guide to see if this is a flagrant abuse.
Comment #22
dcrocks commentedActually the current implementation violates the Seven Style Guide . From the Typography section:
"Body text is 16px/24px Regular. All text is 90% black (#1a1a1a) unless otherwise noted. A baseline grid of 24px is used throughout, relatively strictly for running text and for spacing between elements, less strictly within some UI components where other requirements come into play."
The current implementation gives 13px/20px. The body attribute should be '100%/1.538em'
Comment #23
dcrocks commentedThough this is such a small patch, this is one more iteration.
Comment #25
dcrocks commented23: 2045473_23_Bartik_and_Seven_font_size_too_small.patch queued for re-testing.
Comment #26
sqndr commentedThe line height is now (slightly) different in both themes, right? For Seven, the line height is 1.538em and for Bartik it's 1.5. Should 't they both use the same line height to be somewhat more consistent?
Comment #27
dcrocks commentedProbably, since they are now applied to the same value. 81.3% of 16 gave 13.008 times 1.538 resulted in 20.006 for line height. 16 times 1.538 gives 24.608 for line height. Forget what browsers do with extra decimal points. Will fix, but still waiting for some comment about overall affect of this change from someone with good vision.
Comment #28
lewisnymanWoah, hold up a second. Isn't the whole reason we set the percentage on font size is so users can increase/decrease it at their preference. 16px is way too big for a complex UI. Note that the Seven style guide's typography guidelines are made with Source Sans in mind. For Lucida Grande it's way too big.
Comment #29
dcrocks commentedUsers can still increase/decrease at their preference. And Bartik is not a complex UI. The discussion I've read, at least recent commentary, recommends 16px base and modification according to content. More text in a given area is not more stylish than readable text. This is an accessibility and design issue. If the font choice makes for problems then maybe Bartik needs some re-design, because I thought Drupal has made accessibility a priority.
Comment #30
sqndr commentedThere's an interesting article from smashingmagazine about body copy font size. You can read the article here.
"The problem here is a basic usability and accessibility issue: a good design should look good without requiring the user to enlarge or reduce the text size.”
- From W3, more here
Comment #31
lewisnymanWe can't please everyone. Everyone has a their own preferences for font size. Some may prefer more than 16. I don't believe that there is a blanket rule: “All websites must now just 16px base font sizes”.
The typeface makes a big difference, here's a comparison of Source Sans and Lucida Grande both set at 16px.
Having said that, feel free to play around. If Bartik looks great at 16px then it's win win. It's a 100% design decision though. We shouldn't force this through.
Comment #32
dcrocks commentedA nitpicking update. This only affects Bartik and Seven. The net affect is greater accessibility at the cost of slightly taller pages for Bartik, install, and admin pages. True, 16px for body element font size is not a standard but the only survey I located showed that it is the most frequent, if not near a majority. However, I think 100% is recommended by the W3C, at least implicitly. And, if we can't please everyone, we can at least adopt a choice with a positive rationale, rather than the ambiguity of 'style'. I agree this is a design decision, which, of course, includes accessibility as a parameter.
Comment #33
mgiffordThis looks good to me. I like the "adopt a choice with a positive rational" approach @dcrocks!
Seven comparison 100%:

Bartik Comparison 100%::

Comment #34
joelpittetRTBC++ good decision 100% on 100%.
Comment #35
lewisnymanWe need more extensive testing than that. We use ems all over the place, so changing the body value changes everything relying on it, that a lot of potential broken pages. The headers are now different sizes and the installation steps look way too big. It's also broken the password indicator, which is set in ems.
Comment #36
Bojhan commentedWow, its quite distressing this has been put to RTBC without thorough testing nor review from maintainers responsible on this front. @mgifford please notify maintainers, when such a big change is put forth.
I do not think the suggested font-sizes matches what we want to do with Seven. I know that the suggested size by W3C is larger, but it really screws up all of our pages - our design can't accommodate such a large font. Also keep in mind that Seven is an application interface, not a article interface - it is optimized for scanning. This also blatantly disregards all the thinking we have done around typography in Seven as shown in the style guide. As far as I am concerned, we cannot enlarge it to this extend in Seven.
Comment #37
mgifford@Bojhan - Sorry. No distress was intended. I had somehow thought you'd already seen this. I will be more careful in the future. As always your views are very important with this and other design issues.
So if not 100%, how much larger do you think we could take Bartik so that it was consistent with how large we could allow Seven? I can't make a call about how close we can get to 100% from the existing 87.5%. Maybe it's only 90% at this stage in D8 and we strive for 100% in D9.
@LewisNyman - Thanks for the additional screenshots with problematic areas. Thanks for setting this back to Needs Work.
Comment #38
droplet commentedShould be always compared on both Windows & Mac platforms. Ideally, it should checked on Macbook & regular laptops. I think if you're working on macbook retina all days, you seldom notice small font issues.
Comment #39
Bojhan commented@mgifford No problem, I think its good for "major" changes to always get some visual design review.
I think its mostly about optimization for Bartik. I think 95% is as far as we can stretch it without having to change line height, etc. Though I already see some proportional issues with the links in the menu (body text too large in contrast to links in the menu). I am not sure if we still have a Bartik maintainer?
I would have to investigate Seven, we kinda tuned a lot of it already over the past year. As Lewis mentioned already its an application UI, to which other principles apply. We can obviously try to make it larger, but as Lewis clearly pointed out there are a lot of different interfaces to keep in mind (e.g. views, field ui, etc.)
Comment #40
dcrocks commentedEven on the many high res displays becoming available, 13px and lower is still a problem for some of us. It is clear that there is some serious font size compounding going on in Seven, possibly less in Bartik. It won't be easy to fix that but I would hope that both would try to improve their accessibility to a broader range of viewers.
Comment #41
Bojhan commented@dcrocks I would consider separating this issue for Seven and Bartik. Seven is I think harder, and possibly we should try to bump text more selectively.
Comment #42
dcrocks commentedI think that would be better too, but I think the problem title is a little too simplistic now. Possibly rationalize/optimize font size choices for bartik/seven?
ps. I checked and there at least 14 different css files that affect the display of the install pages.
Comment #43
lewisnymanI think it might be easier to split Bartik and Seven into separate issues? The rationale and considerations are different for each.
Comment #44
dcrocks commentedI created a new issue for Bartik.
Comment #45
dcrocks commentedComment #46
lewisnymanUpdating the title to sound like a feature request and knocking down from major, feature requests can't be major :-)
Comment #47
charles belovI'm finding the detail text too small even at 175% zoom.

Comment #48
dcrocks commentedSimply setting the body font size larger doesn't work because it distorts the display too much. What I have focused on is leaving large elements the same size and trying to make sure there are no elements smaller than 1em. It seems the tweaking can become interminable. And, of course, there are other distractions.
Comment #49
lewisnyman@dcrocks That sounds achievable, do we need to change the title and issue summary?
Comment #50
dcrocks commentedChanged summary.
Comment #51
lewisnymanComment #52
chippper commentedJust trying to tackle some low hanging fruit. I updated style.css and vertical-tabs.css to up every font-size under 1em to be 1em. There were no other font-size declarations in Seven that I could find. In my testing there doesn't seem to be any regression in layout or design.
There was also one instance of a font-size being set to 12px (line 1256 - .views-ui-display-tab-bucket h3), but upping that to 1em also didn't result in any regression.
Comment #53
sarahjean commentedI tested this locally, checking the admin pages and it seems like setting these font sizes up to 1em does make things a lot more readable. I agree with dcrocks that the tweaking could become interminable if we try another approach. I checked through the css files in seven and with this patch there are no font sizes below 1em now.
Comment #54
lewisnymanHey, can we please get a before/after screenshot? Just so it's clear what has changed in the UI? There are a lot of changes here.
I think we should not touch the Views UI. It's fragile and I think that any design change needs to be considered with the rest of the UI
One more point, if we are just setting everything to 1em, do we need a font size property? Isn't the default 1em?
Comment #55
chippper commentedAgreed on removing the font size declaration altogether if it's just 1em. I've done just that, and removed whole rules that were nothing but said font size declaration. Also: Screenshots!
Comment #56
chippper commentedJust double checked vertical tabs, as well - see the screenshot:
This is the one place I've observed any particular ramifications of changing the font size declarations (see the pink arrows).
The summary text on vertical tabs, which once fit nicely on one line, sometimes runs to two lines.
That being said, I see this as an acceptable change. There will be lots of vertical tabs, with lengthy summary text strings, that will inevitably run to two lines. It just so happens the the default summaries on the default content types happened to fit on one line, but now no longer do. I also think it's a price worth paying in the interest of readability.
Comment #57
chippper commentedUpdating status.
Comment #58
lewisnymanComment #59
dcrocks commentedI would like to make one other suggestion: Change the body font size from 81.3%(13px) to 87.5%(14px), which is the same as Bartik. That slight tweak is still positive without distorting anything in the current patch output. I tried the patch as is and with that change and found the output slightly better for my eyes without adding any additional distortions.
Comment #60
lewisnymanWhich pages did you test? This change requires us to test every page. We can try this but only it's done properly.
Comment #61
Bojhan commentedAdjusting the body font-size is not within scope of this issue, thats exactly the things we wanted to avoid.
I am really not so sure about these changes, the text in the configuration screen looks ridiculously big. The form labels vs. descriptions balance is now so off, that its not a small size tweak anymore - there is a big difference between the two.
I don't know, all of this text is highly optimized - now it just feels like we are making it all out of balance. I am still really unsure about this issue in general, we don't have incredibly small fonts like other platforms and our interface zooms very well. The small tweaks we do, won't be enough for those with less sharp vision.
Comment #62
dcrocks commentedTweaking a completed design is difficult. But using browser zoom introduces even more distortions and this patch thus far does minimize them. I would hardly consider the text changes on the configuration page going from 12px to 13px, as 'ridiculous'. I admit I am more concerned about readability than aesthetics, and though I don't think this patch goes far enough I am concerned that if nothing is done now, there will never be any improvement. If the core themes are redesigned for D9 I don't think there will be any more effort to improve readability for the many(if not the majority) of people with less than 100% visual acuity than there was going from D7 to D8 if some stand is not taken now.
Comment #63
lewisnymanImprovements are fine but we are not in a position where we can introduce design regressions. Why don't we optimise how we handle user zooming instead of trying to remove the need to zoom?
Comment #64
dcrocks commentedNo idea as how to go about that. But still consider #55 an improvement, of both accessibility and usability, and not a regression.
Comment #65
chippper commentedI guess I'm not clear as to whether or not the change as I pointed out in #56 is considered a regression. I don't think it is, for the reasons I outlined in that comment.
As far as I could tell, the text defaulting to a calculated 13px didn't really affect anything else.
Comment #66
charles belov#63: Again, the issue with zooming is that it makes everything larger, not just the things that are too small. This can result in other things becoming too large to read easily.
For example, the largest text might become sufficiently large that it gets pushed outside the viewport.
The idea is to reduce the ratio between the smallest text and the largest text by making the smallest text sufficiently large without disturbing the larger text, which is already large enough without being excessively large. Zoom does not accomplish that.
Comment #69
dcrocks commentedWith all that's be done to seven in the last 2 months, this needs reroll.
Comment #70
mgiffordComment #71
jjcarrionI'm going to take a look here.
Comment #72
jjcarrionI have made the manual reroll.
Comment #73
dcrocks commentedYou have some overlap with #2346791: Remove id selectors from page template of Seven /
Comment #74
star-szrComment #75
lomo commentedNot sure I'm qualified to mark this RTBC or not, after all (not a themer).
Comment #76
lomo commentedComment #77
joelpittetAn automated CSS regression test would be nice here. Anybody know of some tools we can throw at this?
Comment #78
chx commentedThis is not novice. And #56 has screenshots.
Comment #79
mgiffordIs this going to have to get bumped to 8.1.x.?
Comment #80
Bojhan commentedNo, and this is no feature request - its an a11y related change.
Comment #81
lewisnymanIt is a feature request. There's an easy feature for accessibility that is built into all browsers, increasing the font size.
Comment #82
Bojhan commentedOk, makes sense. Though we need better distinction - because OS's also have loads of features around a11y (e.g. high contrast mode) and yet we don't depend on them. Saying we do depend on this one in browsers, and therefor mark it a feature request - seems like a one off.
Comment #83
lewisnymanYes that is true, maybe the distinction is where we support these OS features instead of eliminating the need for them.
We have it built into our CSS best practices to support browser font resizing, we use ems instead of pixels. to achieve this. Another example is the
Drupal.announnceJS library which is built to allow core/contrib to easily take advantage of an OS feature.Sometimes it feels like we are throwing the baby out with the bathwater, when we push a change through under the 'a11y' banner.
Comment #84
dcrocks commentedIt isn't as if this is a recent issue. Before this issue was created I know I made comments about this in D7 Seven and Bartik issues. It would be sad to keep pushing this back. And I'm not optimistic that any Seven successor nor Bartik would address it either unless it was addressed here.
Besides the 'ally' banner, I just think from a usability viewpoint small font content tends to be ignored content, sometimes with unwanted consequences.
Comment #85
lewisnymanThat's an intentional design decision, hierarchy. Not every piece of text on the page has equal value, so we emphasise more important text using font size.
The latest patch removes hierarchy, so it's a design regression:

I would rather we ensure that the theme supports text resizing rather than introduce design regressions. If we can increase font sizes without regressions then let's do that instead.
Comment #86
dcrocks commentedWe are talking about a browser. Drupal isn't the only page I visit. I already have the base font size set in my browser to larger than the default. There isn't any 1 or 2 or 3 things I can do to make my browser work with all the sites I visit. I don't expect I have any choice about this.
The problem with Seven and Bartik is that they both reduce the base font size significantly, making 1 em 14px and 13 px respectively, setting the base or 'normal' font size of the hierarchy to a small size. But changing those values won't work because the hierarchy doesn't expand well via multiplication.
This patch addresses this by flattening the hierarchy, including more elements into the 'normal' font size without disturbing the larger elements. I'm involved in this issue because I want to improve Drupal, so I consider this issue to be about a problem, or a bug fix, and not a feature request. I consider this a fix and not a regression.
Comment #87
charles belovThe problem with using zoom to deal with this is that zoom makes everything larger, not just the thing that is too small, making the largest text cartoonishly big.
One question would be whether the themes respect a browser setting of minimum font size, as opposed to zoom, without causing obscuring or overprinting of text. This setting is available in Firefox's advanced font settings. I remember it being in Safari, but don't have a Mac handy to confirm whether it is still a feature.
Comment #88
idebr commentedPatch no longer applies:
error: patch failed: core/themes/seven/css/components/breadcrumb.css:2
error: core/themes/seven/css/components/breadcrumb.css: patch does not apply
error: patch failed: core/themes/seven/css/components/help.css:1
error: core/themes/seven/css/components/help.css: patch does not apply
Comment #89
njbarrett commentedRerolled on 8.0.x
Comment #90
mgifford@njbarrett - So no changes from #72 other than the reroll?
There are some elements which need work based on @LewisNyman mentioned in #85.
Comment #91
njbarrett commented@mgifford - No I just rerolled it so the patch applies. Still new to contributing :)
Comment #92
mgiffordNo problem. Do you have time to try to address some of the other issues that were mentioned?
Your re-roll seems fine. Bot likes it. Let's see if we can get you a patch in Core.
Comment #93
dcrocks commentedre: #85. All this patch does is flatten the bottom of the text hierarchy, so important text remains important and unimportant stays unimportant, with the reward of improved usability. So I wouldn't consider this a regression, but rather an improvement to accessibility.
Comment #94
njbarrett commentedI've rolled a new patch that improves the font size for many elements, and addresses the concern in #85 with regard to vertical tab descriptions. If we increase the size of the vertical tab title, then we would have to increase the size of all labels to maintain the design proportions. I propose setting the descriptions to 0.95em - only a minor decrease in size but still noticeably smaller than the title of the tab. Screenshots attached.
Comment #95
njbarrett commentedHiding older files
Comment #96
joelpittetMaybe Lewis can have another look at this. I'm actually still a big fan of #32 :P
Thanks for the screenshots @njbarrett. If you use dreditor, there is some handy embed buttons to easily embed the images in the comment.
Comment #97
dcrocks commented#32 is probably too simple. There isn't any problem with the larger text items, just the small ones. I've given up on any significant redesign of the text items in Seven or Bartik. I can only hope that if a new core theme is developed someone actually thinks about this. But this last patch offers improved accessibility at little cost to the theme's UI. I'm hoping this can go in before 8 is shipped and the same solution can be applied to Bartik, which needs it more.
Comment #98
lewisnyman#32 is too simple, it seems like we are making good progress to ensure we don't introduce design regressions, thanks for the work.
Look
Looks like we need a screenshot of this element, which appears alongside the body field input
Also can we get a screenshot of tables with content in? There are a few that this patch could affect, such as field ui, block placement, and views listings.
Comment #99
joelpittetThanks @dcrocks and @LewisNyman. I'll likely be playing with something like this: http://typejs.org/ with min-max font-sizes for fun.
@njbarrett mind doing up the screenshots mentioned in #98?
Comment #100
njbarrett commentedHere's some screenshots of the filter wrapper and the views table.
Comment #101
njbarrett commentedComment #102
lewisnymanI am happy with the changed here.
Sorry! I was going to RTBC but I realised that we don't have a screenshot for the panel title in Seven (/admin/config)
Also, I noticed that form-descriptions.png is a screenshot of the form descriptions, and help.png is a screenshot of the appearance page?
Comment #103
njbarrett commentedRerolled patch file on 8.0.x
Comment #104
dcrocks commentedComment #105
njbarrett commented@LewisNyman
I've attached a screenshot of the panel titles - I actually think these might be too big now, as they are reverting to the h3 style in elements.css (see panel-title-patch-#103). Adding a font size: 1em makes it slightly bigger than the previous 0.923em. I uploaded a screenshot of this suggestion as panel-title-patch#104
Regarding help screnshots, this is the region that appears under messages on some pages. I attached another screenshot showing the difference on the /admin/modules page.
Comment #106
lewisnymanAh yeah, for some reasons I thought .help was only for the help page.
In each situation I think the font size change has been minor enough to not ruin the visual heirachy of the component, in most cases the heirachy is communicated in other means, such as color.
Thanks for the hard work here.
Comment #107
sqndr commentedNice! :)
Comment #108
alexpottThis is a task not a feature request - it looks like a usability and accessibility improvement. This issue is a normal task so we need to outline how it fits within the allowable Drupal 8 beta criteria. Can someone add Drupal 8 beta phase evaluation template to the issue summary.
Comment #109
njbarrett commentedAdded the beta evaluation phase table
Comment #110
joelpittetBack to RTBC, thanks @njbarrett for filling out the beta eval.
Comment #111
alexpottCommitted 0c7e1e9 and pushed to 8.0.x. Thanks!
Thanks for adding the beta evaluation to the issue summary.
Comment #114
mgifford