How is "If you use the `size` prop, the font size of the heading will automatically decrease in size for smaller screens." true?
See original GitHub issueDescription
While reading through the documentation, I noticed that the <Text>
component examples uses fontSize
as props, while <Heading>
examples uses size
.
The documentation explains this with
To increase the size of the heading, you can use the fontSize or size props. If you use the size prop, the font size of the heading will automatically decrease in size for smaller screens.
However, how is this true if both size
and fontSize
props use rem as sizes?
- https://github.com/chakra-ui/chakra-ui/blob/main/packages/theme/src/foundations/sizes.ts
- https://github.com/chakra-ui/chakra-ui/blob/main/packages/theme/src/foundations/typography.ts#L47
Shouldn’t the size
prop then use an array of values?
Or why even have the inconsistency of size and fontSize. Stay true to the native attribute fontSize
like you also mention here in the documentation.
Issue Analytics
- State:
- Created a year ago
- Comments:10 (5 by maintainers)
Top Results From Across the Web
font-size - CSS: Cascading Style Sheets - MDN Web Docs
The font-size CSS property sets the size of the font. Changing the font size also updates the sizes of the font size-relative <length>...
Read more >Responsive And Fluid Typography With vh And vw Units
On a small screen, heading sizes should be more uniform; a large screen has room for greater variation. We can use the typographic...
Read more >Linearly Scale font-size with CSS clamp() Based on the ...
Any viewport width between 361 and 839 pixels needs a font size linearly scaled between 1 and 3.5rem. That's actually super easy with...
Read more >React Native Responsive Font Size
We can use flex layout and use adjustsFontSizeToFit={true} for responsive font sizes.And the text would adjust according to the size of the container....
Read more >Fluid font sizes in WordPress 6.1
This is to not only make the job of calculating the clamp formula easier, but to encourage the use of relative sizes: setting...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Could you do that? I still have an open MR https://github.com/chakra-ui/chakra-ui-docs/pull/657 and am busy with a project 😃
Yeah, that would be a good idea as well! You wanna do that?