Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Too small font in react app with typescript example #10532

Closed
Liero opened this issue Mar 5, 2018 · 3 comments
Closed

Too small font in react app with typescript example #10532

Liero opened this issue Mar 5, 2018 · 3 comments
Labels
support: question Community support but can be turned into an improvement

Comments

@Liero
Copy link

Liero commented Mar 5, 2018

I've based my app on https://github.com/mui-org/material-ui/tree/v1-beta/examples/create-react-app-with-typescript

I'm trying to include very basic navbar:

const styles: StyleRulesCallback<'root'> = theme => ({
  root: {
    textAlign: 'center',
    paddingTop: theme.spacing.unit * 20,
  },
});

class App extends React.Component<WithStyles<'root'>, {}> {
  
  render() {
    return (
      <div className={this.props.classes.root}>
     
          <AppBar>
            <Toolbar>
              <Typography variant="title" color="inherit">
                 Title
              </Typography>
            </Toolbar>
          </AppBar>

      </div>
    );
  }
}

export default withRoot(withStyles(styles)<{}>(App));

It seems like all the fonts in material ui components are small. buttons, select, typograhy.

For example, why I see this:
Imgur

instead of https://material-ui.com/demos/app-bar/

I mean why is the font so small?

image

@Liero Liero changed the title Typography in create react app with typescript example Too small font in react app with typescript example Mar 5, 2018
@kgregory
Copy link
Member

kgregory commented Mar 5, 2018

The h2 element rendered by Typography has the correct font-size applied for that variant: 1.3125rem.

As a unit for font size, rem is a multiple of the default base font-size, typically defined for the html element. Inspect your document, is there a font-size defined on your html element?

Would you be able to reproduce this in codesandbox?

@oliviertassinari oliviertassinari added support: question Community support but can be turned into an improvement waiting for user information and removed examples labels Mar 5, 2018
@kgregory
Copy link
Member

kgregory commented Mar 5, 2018

As an aside, this type of thing is perfect for StackOverflow. If you post a question, you're likely to get some help. There are a lot of active community members there. Issues are different from support questions.

We'll hold out for more information from you, but at first blush, this doesn't seem to be a problem with material-ui.

@oliviertassinari
Copy link
Member

People can disable this accessibility behavior by setting the following style:

html {
  font-size: 16px;
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
support: question Community support but can be turned into an improvement
Projects
None yet
Development

No branches or pull requests

3 participants