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.

RFC: material typography spec v2

See original GitHub issue

This is a proposal for a migration path from the v1 typography spec to v2.

Breaking changes

  • every variant will have a primary color. The spec does not list color as a property of typography.
  • removes the following variants:
    • display1
    • display2
    • display3
    • display4
    • headline
    • title
    • subheading
  • changes the style of the following variants:
    • body1
    • body2
    • caption
    • button

Implementation

Color

The spec does not mention color. Use primary by default and apply color manually on every usage.

Variant Name

Use names from spec but use headlineX instead of hX which matches mwc implementation

Roadmap

  • new minor (implemented with #12916, scheduled for 3.2.0):
    • add new variants from the spec, conflicting names will be suffixed with Next
    • ~set suppressDeprecationWarning on every internal Typography usage to suppress warnings. They are for the user not the dev.~ Users should be warned if an internal component uses a deprecated variant. Recommend setting useNextVariants per component.
    • show deprecation warnings for categories that will be removed or restyled in a new minor version
    • expose useNextVariants to Typography. This will use the style of variants in the next major (~only concerns variants that will be restyled~ for all variants so that using useNextVariants has no breaking change when switching to new major)
    • update typescript definitions
    • recommend new variants and colors that should replace deprecated variants
    • Update docs to use typography v2
  • new major with:
    • useNextVariants, suppressDeprecationWarning will become noop props
    • write codemod for migration:
      • remove useNextVariants, suppressDeprecationWarning props
      • apply new variants and colors according to recommendation
    • refactor internal usage of Typography, use codemod
    • remove old variants
  • new minor with:
    • warn when using useNextVariants, suppressDeprecationWarning because noop

If we don’t consider style changes a breaking change we can skip the hole suppressDeprecationWarning step which reduces the workload but is probably annoying for users that aim at pixel perfect apps.

Misc

Spec:

Existing Implementations:

Related:

@oliviertassinari Could you ping core contributors?

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:3
  • Comments:35 (25 by maintainers)

github_iconTop GitHub Comments

5reactions
nathanmarkscommented, Sep 12, 2018

I say we just include the deprecation warnings and remove them in the next major.

Read more comments on GitHub >

github_iconTop Results From Across the Web

RFC: material typography spec v2 · Issue #12741 - GitHub
This is a proposal for a migration path from the v1 typography spec to v2. Breaking changes every variant will have a primary...
Read more >
RFC 1866 - Hypertext Markup Language - 2.0 - IETF Datatracker
Hypertext Markup Language - 2.0. RFC 1866 · This document specifies an Internet standards track protocol for the Internet community, and requests discussion...
Read more >
RFC 8081: The "font" Top-Level Media Type
1. Generic SFNT Font Type Type name: font Subtype name: sfnt Required parameters: None Optional parameters: 1) Name: outlines Values: a comma-separated subset ......
Read more >
The type system - Material Design
A sans serif typeface is used for Body 2. Don't use expressive fonts, including display, handwritten, and script styles for body copy.
Read more >
Cascading Style Sheets Level 2 Revision 1 (CSS 2.1 ... - W3C
It is a stable document and may be used as reference material or cited from another document. W3C's role in making the Recommendation...
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