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.

Heading components (H1,H2,H3,H4,H5,H6) are not mapping as per documentation

See original GitHub issue

Hi there,

In the documentation on the README.MD file we have the following section:

export default {
  colors: {
    text: '#000',
    background: '#fff',
    primary: 'tomato',
  },
  spacing: [10, 12, 14],
  fontSize: [16, 20, 24],
  text: {
    h1: {
      fontSize: 3, // this is 24px, taken from `fontSize` above
    },
    p: {
      fontSize: 1, // & this is 16px, taken from `fontSize` above
    },
  },
}

After testing this, I found that:

h1: {
      fontSize: 3, // this is 24px, taken from `fontSize` above
    },

For me, the 3 is used as the font size in pixel (3 pixels) and not mapping to the fontSize set (fontSize: [16, 20, 24],) above.

Is this expected? When I avoid putting the H fontSize styling into my theme, the defaults are working correctly when switching H1 to H2, to H3 and so on…

If this is expected, how would one map other text components if Heading (H) components are just defaulting.

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
daxfrostcommented, Sep 24, 2020

I created a PR for fixing the documentation: https://github.com/nandorojo/dripsy/pull/38

1reaction
daxfrostcommented, Sep 24, 2020

I actually verified that it wasn’t outside the range before making this issue.

That said, I just changed fontSize: [16, 20, 24], to fontSizes: [16, 20, 24], and now it works… 🤔

Read more comments on GitHub >

github_iconTop Results From Across the Web

Headings | Web Accessibility Initiative (WAI) - W3C
Skipping heading ranks can be confusing and should be avoided where possible: Make sure that a <h2> is not followed directly by an...
Read more >
<h1>–<h6>: The HTML Section Heading elements
Heading information can be used by user agents to construct a table of contents for a document automatically. Do not use heading elements...
Read more >
Google Explains How to Use Headings for SEO
Google's John Mueller explains the proper use of heading elements (H1, H2, H3) for SEO.
Read more >
HTML Headings: The Complete Guide To Adding Headlines ...
HTML Headings: The Complete Guide To Adding Headlines For Document Structure. In HTML Tags. Disclosure: Your support helps keep the site running!
Read more >
Headings | Usability & Web Accessibility - Yale University
Table of Contents Benefits of Headings Using Headings Development Best ... in the header and the document title both <h1> elements is becoming...
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