react-truncate
react-truncate copied to clipboard
Allow passing in font style overrides?
For text whose styles, particular font-size, can shift around, it can be necessary to put the ...
on the text assuming it's the largest size it'd ever be. This can be necessary for design in consistency and accessibility.
Example: if text starts at font-size: 20px but can go up to 22px, and it's desired to not change what text is displayed on the screen, react-truncate should be told to assume 22px.
There are some valid use cases where you'd want to override the default behavior (reading the font from getComputedStyle
), e.g. #93 comes to mind.
So - I'm very positive about that feature
Closing out my old issues in repos that haven't had updates in a few years. Cheers!