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.

Allow responsive font sizes in theme.

See original GitHub issue

Without predefining a component which feeds an object of font sizes into the fontSize prop there doesn’t seem to be a way to quickly and consistently apply responsive font sizes.

It would be very handy to be able to do this:

//theme.js
const fontSizes = {
  ...
  ...
  ...
  ...
  "6xl": { base: "42px", md: "54px", lg: "64px" },
}

Or perhaps add a new theme object entirely

//theme.js
const fontSizes = {
  ...
  ...
  ...
  ...
  "6xl": "64px" ,
}

const fluidFontSizes = {
  ...
  ...
  ...
  ...
  "6xl": { base: "42px", md: "54px", lg: "64px" },
}

Issue Analytics

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

github_iconTop GitHub Comments

2reactions
agentlewiscommented, Jan 26, 2021

Oh thanks so much - thats exactly what I needed! inner-critic attack alleviated.

2reactions
TimKolbergercommented, Jan 26, 2021

See this codesandbox for reference: https://codesandbox.io/s/chakra-ui-responsive-heading-4bh4p?file=/src/App.tsx

<Heading size="xl" is not the same as <Heading fontSize="xl". The fontSize prop only applies the fontSize, the size prop applies the defined styles from the theme.

Read more comments on GitHub >

github_iconTop Results From Across the Web

The Beginner's Guide to Responsive Text on the Web
Learn two easy ways to create page text that sizes appropriately based on the user's device, desktop or mobile.
Read more >
Responsive font size in CSS - Stack Overflow
first one is the minimum allowed font-size. ... can be used but you have to use minimum 3 media-queries to make the font...
Read more >
Responsive Font Sizes In Your WordPress Website (The ...
In this article, I will go through everything you need to know to understand responsive font sizes by breaking down how the Astra...
Read more >
Typography - Material UI - MUI
To automate this setup, you can use the responsiveFontSizes() helper to make Typography font sizes in the theme responsive.
Read more >
How To Create a Responsive Text - W3Schools
Responsive Font Size. The text size can be set with a vw unit, which means the "viewport width". That way the text size...
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