question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Typography: Header Elements Lose Semantics

See original GitHub issue

I see the topography example includes the following HTML which I believe is counter to the HTML spec which states “The h1 element is said to have the highest rank, the h6 element has the lowest rank” https://www.w3.org/TR/html5/sections.html#the-h1,-h2,-h3,-h4,-h5,-and-h6-elements

Typography Example Includes:

        <h1 class="mdc-typography--display4">Display 4</h1>
        <h1 class="mdc-typography--display3">Display 3</h1>
        <h1 class="mdc-typography--display2">Display 2</h1>
        <h1 class="mdc-typography--display1">Display 1</h1>
        <h1 class="mdc-typography--headline">Headline</h1>

Why not simply give authors the ability to globally turn MDC Typography on and off by toggling a class on the body or html. As for granular control why not simply add class “mdc” to any type header, i.e., why do we need “-typography–display4” and “-typography–display3”?

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
ronnieroystoncommented, Apr 28, 2017

Looks like what is rendered using <h2> thru <h6> is identical to all <h1>'s. I think if you update the typography demo to use <h2> - <h6>, that would be helpful. As it is, it appears to suggest the usage of only <h1> tags.

0reactions
amsheehancommented, May 1, 2017

After discussing with the team, we feel that leveraging semantic names for styling considerations runs perpendicular to what semantic markup is all about. e.g.: <h1> - <h6> are semantically meaningful to browsers and web crawlers, but there should be a clear separation from what it means for style, as heading elements really only provide baseline styles with regard to typography.

Further, if we were to add a global flag to control for mdc-typography it means we’re being a little too strict in assuming that the user wants to use Roboto, that display styles are only used on heading elements, that all heading elements are Material Design elements, etc…

As @Garbee stated, we feel it is better for our users to use @extend on our set of mdc-typography styles, or in simple cases, just override the compiled CSS. This approach would be completely appropriate if a user would like to re-map mdc-typography--display* styles to the heading elements of the corresponding level.

As far as changes to the demo, we are always happy to review any pull requests from the community. Thanks!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Typography: Separating Style from Semantics
If we prioritize styles, we conform to design constraints but lose the heading hierarchy. Even worse, this results in misleading headings that ...
Read more >
Chapter 9: Typography - Web Style Guide
Encoded semantics: With web typography, hierarchy and relationships are encoded into text, such that the information is available programmatically and can ...
Read more >
Typography - Foundations - Human Interface Guidelines
Be sure to maintain the relative hierarchy and visual distinction of text elements when people adjust text sizes. Minimize the number of typefaces...
Read more >
An abstraction called text styles – How to save yourself from a ...
This way, we have a single place where all different typography styles are clearly visible. Also, these styles aren't attached to any semantic...
Read more >
Typography - Basic Elements - Pattern Library
Section headings; Grouping content; Text-level Semantics; Tabular data ... Any header elements may include links, as depicted in the example.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found