Skip to content

Difference between demo website and usage themes #261

@nitzano

Description

@nitzano

Hya,

I've tried to use the typography-theme-moraga and compared the results to the demo in https://kyleamathews.github.io/typography.js/ after selecting the same theme.

In the demo website the moraga theme settings looks like this:

image

Checking the h1 tag gives font-size of 2rem (36px) and line-height of 2.34rem:

image

However in the source code of the package and react project (without any other css) the h1 tag gets font-size of 2.5rem (and indeed the scaleRatio in the code is 2.5) and line height of 1.1.

image

generated h1 css with typography.toString():

h1 {
  margin-left: 0;
  margin-right: 0;
  margin-top: 0;
  padding-bottom: 0;
  padding-left: 0;
  padding-right: 0;
  padding-top: 0;
  margin-bottom: 1.56rem;
  color: hsla(0, 0%, 0%, 0.85);
  font-family: "Source Sans Pro", sans-serif;
  font-weight: 200;
  text-rendering: optimizeLegibility;
  font-size: 2.5rem;
  line-height: 1.1;
}

Can someone please explain why the results are different and which ones are the "correct" (the demo website or the actual usage).

Thanks

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions