Problem/Motivation

The Bartik theme sets its base font size to 87.5% for the body. The end result are pages with font sizes ranging from 12px to 24px. For most content the font size is smaller than my browser's default (15px for the main content, 12.8px in the sidebar, 12px in the footer).
I have aging eyes. Therefore I set the default font size in my browser to higher than the common default of 16px, which sometimes breaks form layouts. Or I have to use the browsers zoom feature, a blunt tool that can be more annoying than helpful, and one that many don't know exists.

Proposed resolution

  • For body, set font-size:100% to honor users' browser preferences
  • For all other selectors, modify font size as needed to maintain form structure and text size balance across a page, but never hide content from low vision users by using a font size that's less than 1em.

I believe in stylistic choice and won't recommend this for all themes, but since Bartik is the default 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).

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

dcrocks’s picture

Please read the discussion in #2045473: Improve visibility of Seven's smallest font elements, from which this issue was split, so as to not repeat some of the discussion.

krisp1’s picture

The D8 API source code files font size is also on the small side.

dcrocks’s picture

Most of the drupal web site pages have small fonts, and it ignores my browser settings so I am constantly zooming. Most of the pages are just to busy, but the api pages don't have to use the font sizes they have chosen.

mgifford’s picture

Issue tags: +Accessibility, +font
LewisNyman’s picture

Issue tags: +frontend
cfox612’s picture

Status: Active » Needs work
FileSize
986 bytes

Patch sets body to 100%. Some headlines may need tweaked since they are quite a bit larger.

dcrocks’s picture

Choosing a body font size of 100% seems only to work if the original theme design started with that as a base. Doing it now to Bartik means finding and then fixing all the distortions caused by that change, a truly hit and miss process. I decided, for Seven, I would try to make the smallest elements have a font size of 1em, and then correct problems directly caused by each change. Not always straightforward, but I least I would have a starting point and a chance at a manageable work flow.

ps. Looking at install pages, maintenance pages, Seven, and Bartik, I found at least 10 different css files that influenced output before I quit counting.

meichr’s picture

Assigned: Unassigned » meichr
Issue tags: ++FUDK

Looking into that one.

meichr’s picture

Issue tags: -+FUDK +FUDK

Corrected tag.

meichr’s picture

A test shows that even changing the body font-size to 100% doesn't increase every text element equal to or above 1em (16px). The content font size has 1em, but several other elements are still below 16px, e.g. main and secondary menu links have 14.8667px, submitted text and footer content have 13.7167px.

If those text elements would have to be at a minimum of 1em, it would require to increase content font-size to an even higher text-size to keep the visuals similar to the design intended by the Bartik maintainers.

Patch #6 not only changes the body font-size but also some colors and text-decoration without any hint in the discussion, I would encourage not to mix these changes, if not directly related.

I will remove my assignment for the time being as I will not be able to create a full patch for body font-size to be 100% and most other text elements to be either of the same size as before or be in a visual harmony with that change, shortly. That should give others the possiblity to have a shoot until I find some time again to target this.

meichr’s picture

Assigned: meichr » Unassigned

-assignment

mgifford’s picture

Should this be moved to 8.1.x?

dcrocks’s picture

Now that #2377397: Themes should use libraries, not individual stylesheets has landed, this should just be a re-roll.

mgifford’s picture

Status: Needs work » Needs review
FileSize
332 bytes

Most of the patch is already in Core.

joelpittet’s picture

emma.maria’s picture

Status: Needs review » Needs work
Issue tags: +Needs reroll, +Novice
adci_contributor’s picture

Status: Needs work » Needs review
Issue tags: -Needs reroll
FileSize
364 bytes

rerolled

emma.maria’s picture

Assigned: Unassigned » jensimmons
Issue tags: -Novice

A lot of the font sizes in Bartik are set to be "0.something" ems so these elements will always be smaller than the 100% base font in the patch. This one line patch only increases all of the fonts by 12.5%, does this actually solve the problem?

If people really want this visibility issue solved we need to address this from a design perspective. It would be wrong to just try to increase everything together by a % and then randomly pick elements and increase sizes out of sync with everything else, as we please. I know there are a lot of font size choices in Bartik but there must of been reasons for them originally by @jensimmons.

Assigning to Jen for an overlook of this issue.

Also related to font sizes we have this issue which grepped all of the font size declarations in the whole of Bartik... #2399247: Reduce number of different font-sizes in Bartik for better consistency.

dcrocks’s picture

The current patch will not be satisfactory because it will distort the text size hierarchy. Bartik and Seven have the same problem. The solution proposed in Seven is to revise any font sizes less than 1 em to 1 em. The affect is to flatten the text size hierarchy without distorting other elements.
I have been trying to get some relief on this subject for both Seven and Bartik, going back to when D7 was in beta. There will be, in my opinion, insurmountable opposition to redesigning the text design for Seven and Bartik. Though I wish for a better solution, I am hoping the solution proposed in Seven will be applied here and have some chance of success for both. What I am most afraid of is that this issue will be pushed back yet again to the next release of Drupal, and I am almost certain that in any new core theme that might be proposed, accessibility will again be an afterthought. Why, because there are no affective statements in drupal design standards about accessibility. Good intentions are not sufficient.

meneteqel’s picture

The effect that font sizes seem to small on Bartik sides is also related to the standard font-family definition:
font-family: Georgia, "Times New Roman", Times, serif;

As Georgia has wider characters it is considerably larger than Times at the same font size. Therefore on systems where Georgia is not installed the text is definitely too small. For further explanations on dissimilar font definitions look at the tutorial Font Families for cross-compatible Typography.

From my experience I would suggest something like this:
font-family: Georgia, "Bitstream Charter", "Noto Serif", "Droid Serif", serif;
(Georgia for Microsoft and Apple systems, Bitstream Charter for Linux/X11, Noto Serif for Android and Droid Serif for older Android Systems).

Bojhan’s picture

I still this whole approach is questionable, we do it in Seven. But frankly Bartik has a lot of issues that should be resolved first. The whole body % on text, is awful and makes for improvements that could be resolved by simply making it more consistent #2399247: Reduce number of different font-sizes in Bartik for better consistency.

@dcrocks I'd like to ask you to be considerate of the many hours (often well over 200+) that people even in this thread spend on making Drupal more accessible. Bartik was completely evaluated on an accessibility, we tackled many many important challenges. It was by no means an after thought, neither for Seven. All the text is resizable, which meets the WCAG standard.

dcrocks’s picture

I understand that many hours have been addressed to accessibility issues in Drupal, and that all the core themes have many outstanding issues against them. But these themes leak into many of the themes and sites that drupal adopters build so they have a significant exemplary affect in the drupal world. And I understand that Bartik is a mature theme where blunt force changes such as BODY font size percent changes just wont work. But this particular issue still needs attention after many years of discussion here and in other issues and I just feel it might fade away in the rush to release, again. Maybe there is a better way to address this in the next version of Drupal.

kattekrab’s picture

Issue tags: +font-size

mgifford queued 17: 2247319-17.patch for re-testing.

mgifford’s picture

Issue tags: +Needs reroll

Status: Needs review » Needs work

The last submitted patch, 17: 2247319-17.patch, failed testing.

Sharique’s picture

Status: Needs work » Needs review
Issue tags: -Needs reroll
FileSize
409 bytes

Re-rolled patch.

mgifford’s picture

@Bojhan, can we resolve this or should it be marked Postponed until the font size consistency issue is addressed?

I'm not sure what we're waiting for on this issue, perhaps nothing.

mgifford’s picture

emma.maria’s picture

I don't think a solution of just increasing the body % which affects everything is a great option.
This means every individual component affected by this will need to be visually tested.
To move forward it would be better to have thoughts and individual decisions on the smallest elements plus thorough visual testing just like the Seven issue received #2045473: Improve visibility of Seven's smallest font elements.

mgifford’s picture

Title: Bartik fonts too small » Improve visibility of Bartik's smallest font elements
Status: Needs review » Active

Ok, in line with @emma.maria comment above I've changed the title and listed some of the specific places where font size might be a problem. I've just done this by grepping through the css.

demo-block.css

.featured-top .demo-block {
  font-size: 0.55em;
}

form.css

.comment-form .form-item .description {
  font-size: 0.786em;
  line-height: 1.2;
  margin-left: 120px; /* LTR */
}
.comment-form details.filter-wrapper .tips {
  font-size: 0.786em;
}
.filter-help a {
  font-size: 0.857em;
}

comment.css

.comment__time {
  margin-bottom: 4px;
  color: #68696b;
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 0.733em;
  line-height: 1.2;

}
.comment__permalink {
  font-size: 0.733em;
  line-height: 1.2;
}

site-footer.css

.site-footer .content {
  color: #c0c0c0;
  color: rgba(255, 255, 255, 0.65);
  font-size: 0.857em;
}

header.css

.region-header .block {
  font-size: 0.857em;
  float: left; /* LTR */
  margin: 0 10px;
  padding: 0;
}

table.css

table {
  border: 0;
  border-spacing: 0;
  font-family: "Lucida Grande", "Lucida Sans Unicode", Verdana, sans-serif;
  font-size: 0.857em;
  margin: 10px 0;
  width: 100%;
}

element.css

h5,
.heading-e {
  margin: 1.0em 0 0.5em;
  font-weight: inherit;
  font-size: 0.889em;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
h6,
.heading-f {
  margin: 1.0em 0 0.5em;
  font-weight: inherit;
  font-size: 0.67em;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

content.css

.node__meta {
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 0.857em;
  color: #68696b;
  margin-bottom: -5px;
}
.field-name-field-tags .field-label,
.field-name-field-tags ul.links {
  font-size: 0.8em;
}
.node--view-mode-teaser .field-name-field-tags .field-label,
.node--view-mode-teaser .field-name-field-tags ul.links {
  font-size: 0.821em;
}
ul.links {
  color: #68696b;
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 0.821em;
}
Bojhan’s picture

Why are these a problem in particular? They are in appropriate size to other elements and diminished visually, to elevate other content.

Many of these seem fine to change, except header.css and content.css - also headings is a bit questionable, if we should have any differences on that level anyway.

dcrocks’s picture

It is an accessibility issue. (rant omitted)

joelpittet’s picture

Version: 8.0.x-dev » 8.1.x-dev
Assigned: jensimmons » Unassigned
Status: Active » Postponed

Unassigning @jensimmons and postponing on 8.1.x because this is a feature request. It can still be done/worked on just not likely till 8.1.x branch is opened.

mgifford’s picture

Status: Postponed » Needs review
Tamilselvancst’s picture

I have tested it is working fine.

Version: 8.1.x-dev » 8.2.x-dev

Drupal 8.1.0-beta1 was released on March 2, 2016, which means new developments and disruptive changes should now be targeted against the 8.2.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.2.x-dev » 8.3.x-dev

Drupal 8.2.0-beta1 was released on August 3, 2016, which means new developments and disruptive changes should now be targeted against the 8.3.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Status: Needs review » Needs work

The last submitted patch, 27: 2247319-27.patch, failed testing.

neerajpandey’s picture

Status: Needs work » Needs review
FileSize
30.11 KB
35.59 KB
409 bytes

New Patch created for #27. Tested work properly

mgifford’s picture

Version: 8.3.x-dev » 8.4.x-dev

Drupal 8.3.0-alpha1 will be released the week of January 30, 2017, which means new developments and disruptive changes should now be targeted against the 8.4.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

left’s picture

I can confirm patch #41 works as intended.
The body font size increases from 87.5% (14px) to 100% (16px) - see screenshots.

Before

After

mgifford’s picture

That makes it all bigger, but also is bigger than what is targeted for this issue, which is to address "Bartik's smallest font elements". This just makes the default for everything bigger. That might be fine, but it affects more than what was intended.

See #31 above.

kclarkson’s picture

I have also applied the patch and it did increase the font size. While all elements are impacted the patch does increase font size.

kclarkson’s picture

Status: Needs review » Reviewed & tested by the community
star-szr’s picture

Category: Feature request » Task
Status: Reviewed & tested by the community » Needs work

Thanks everyone for the efforts so far.

See #7, #18, #19, #31, etc. The patch in #41 is essentially the same as the one in #17 (it's just been rerolled/recreated a couple times) so unfortunately it's no more viable now than it was two years ago.

I'd like to see a much more careful, measured approach here - similar to what was done with Seven in #2045473: Improve visibility of Seven's smallest font elements.

Also, I'm changing to a task because the Seven issue ended up being a task.

mgifford’s picture

Thanks @Cottser - I think most accessibility folks see the smallest font on a page should be equivalent to 14px (or possibly 16px).

Given that we've got "12.8px in the sidebar, 12px in the footer" (according to the original post), can we try to bump those up to the equivalent of 14px?

This is likely going to be a big patch affecting a bunch of CSS files.

Version: 8.4.x-dev » 8.5.x-dev

Drupal 8.4.0-alpha1 will be released the week of July 31, 2017, which means new developments and disruptive changes should now be targeted against the 8.5.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.5.x-dev » 8.6.x-dev

Drupal 8.5.0-alpha1 will be released the week of January 17, 2018, which means new developments and disruptive changes should now be targeted against the 8.6.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.6.x-dev » 8.7.x-dev

Drupal 8.6.0-alpha1 will be released the week of July 16, 2018, which means new developments and disruptive changes should now be targeted against the 8.7.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.7.x-dev » 8.8.x-dev

Drupal 8.7.0-alpha1 will be released the week of March 11, 2019, which means new developments and disruptive changes should now be targeted against the 8.8.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.8.x-dev » 8.9.x-dev

Drupal 8.8.0-alpha1 will be released the week of October 14th, 2019, which means new developments and disruptive changes should now be targeted against the 8.9.x-dev branch. (Any changes to 8.9.x will also be committed to 9.0.x in preparation for Drupal 9’s release, but some changes like significant feature additions will be deferred to 9.1.x.). For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 8.9.x-dev » 9.1.x-dev

Drupal 8.9.0-beta1 was released on March 20, 2020. 8.9.x is the final, long-term support (LTS) minor release of Drupal 8, which means new developments and disruptive changes should now be targeted against the 9.1.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 9.1.x-dev » 9.2.x-dev

Drupal 9.1.0-alpha1 will be released the week of October 19, 2020, which means new developments and disruptive changes should now be targeted for the 9.2.x-dev branch. For more information see the Drupal 9 minor version schedule and the Allowed changes during the Drupal 9 release cycle.

Version: 9.2.x-dev » 9.3.x-dev

Drupal 9.2.0-alpha1 will be released the week of May 3, 2021, which means new developments and disruptive changes should now be targeted for the 9.3.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.3.x-dev » 9.4.x-dev

Drupal 9.3.0-rc1 was released on November 26, 2021, which means new developments and disruptive changes should now be targeted for the 9.4.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.4.x-dev » 9.5.x-dev

Drupal 9.4.0-alpha1 was released on May 6, 2022, which means new developments and disruptive changes should now be targeted for the 9.5.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.5.x-dev » 10.1.x-dev

Drupal 9.5.0-beta2 and Drupal 10.0.0-beta2 were released on September 29, 2022, which means new developments and disruptive changes should now be targeted for the 10.1.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

pameeela’s picture

Project: Drupal core » Bartik
Version: 10.1.x-dev » 1.0.2
Component: Bartik theme » Look and Feel

This seems to only apply to Bartik and no other core themes, since the base font size is set there, so moving to contrib.