TylerAPfledderer / chakra-ui-typescale

⚖️ A ChakraUI theme extension for generating type scale.
https://www.npmjs.com/package/@tylerapfledderer/chakra-ui-typescale
MIT License
15 stars 3 forks source link

feat: use `clamp()` optionally for `Heading` #69

Closed TylerAPfledderer closed 2 years ago

TylerAPfledderer commented 2 years ago

Closes #40

This PR adds the clamp() functionality for both font sizes and line heights generated in the sizes theming for the Heading component.

The boolean prop isClamped is added to be able to toggle between the clamp and Chakra's breakpoint array so the user can choose either allow for the smooth size change through various screen sizes, or change the font size based on a sensible breakpoint. This prop defaults to true.

NOTE: This does not included theming with the Text component because the sizes object is not being generated. May be considered in a future PR.

The referenced issue notes including this to the fontSizes theme object. This inclusion will be suspended, either indefinitely or opened in a new issue to be added. (Currently considering the later)

changeset-bot[bot] commented 2 years ago

🦋 Changeset detected

Latest commit: 25bf8f44cabd9873249d5d5e5de07ad5e6926564

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package | Name | Type | | ------------------------------------- | ----- | | @tylerapfledderer/chakra-ui-typescale | Minor |

Not sure what this means? Click here to learn what changesets are.

[Click here if you're a maintainer who wants to add another changeset to this PR](https://github.com/TylerAPfledderer/chakra-ui-typescale/new/feat/clamp-scale?filename=.changeset/gold-snakes-own.md&value=---%0A%22%40tylerapfledderer%2Fchakra-ui-typescale%22%3A%20patch%0A---%0A%0Afeat%3A%20use%20%60clamp()%60%20optionally%20for%20Heading%20sizes%0A)