Skip to content

Inverse font size from theme #10579

@franciscop-invast

Description

@franciscop-invast

The font-size behaves the opposite way than in CSS and is not documented:

// Normal font-size
createMuiTheme({ typography: { htmlFontSize: 10 } });

// Expected 2x the previous font-size, instead got 0.5x
createMuiTheme({ typography: { htmlFontSize: 20 } });
  • I have searched the issues of this repository and believe that this is not a duplicate.

Expected Behavior

The font-size depends on the property htmlFontSize.

Current Behavior

The font-size is inversely proportional to the htmlFontSize instead of directly proportional.

Steps to Reproduce (for bugs)

If YOU DO NOT take time to provide a codesandbox.io reproduction, should the COMMUNITY take time to help you?
I am an OSS developer as well, I think the issue is explained quite clearly and this question is very condescending. I am contributing because I think it might improve material-ui long-term, not to get help.

  1. Set-up a theme with htmlFontSize of 10.
  2. Contemplate its size.
  3. Change the htmlFontSize property to 20.
  4. Marvel at how the text becomes smaller instead of larger.

Context

I was following the theme tutorial. Since there is no documentation on htmlFontSize, the expected result is that it behaves similar to font-size.

Your Environment

Tech Version
Material-UI 1.0.0-beta.36
React 16.2.0
browser any

Metadata

Metadata

Labels

docsImprovements or additions to the documentation.good first issueGreat for first contributions. Enable to learn the contribution process.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions