RFC: material typography spec v2
See original GitHub issueThis 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 settinguseNextVariants
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 usinguseNextVariants
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
- add new variants from the spec, conflicting names will be suffixed with
- 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
- remove
- 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:
- https://material.io/design/typography/the-type-system.html
- https://material.io/design/typography/understanding-typography.html
Existing Implementations:
Related:
@oliviertassinari Could you ping core contributors?
Issue Analytics
- State:
- Created 5 years ago
- Reactions:3
- Comments:35 (25 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I say we just include the deprecation warnings and remove them in the next major.
https://betterwebtype.com/rhythm-in-web-typography