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.

Add ability to document typesets in different units

See original GitHub issue

Is your feature request related to a problem? Please describe. We using rem units in our typography and would like to document it with addon-docs. Right now Typeset component accepts numbers in pixels to show those sizes. If we provide rem units, it works correctly, except for size itself - it shows rempx

Describe the solution you’d like It would be great to accept not only numbers, but strings with units. Since it already works, it should take single isNaN check to determine if it should append px or leave as is. Also types should be changed.

Describe alternatives you’ve considered We can make our own component for Typesets, if you not willing to accept this proposal

Are you able to assist bring the feature to reality? yes, I can… I just need guidance on codebase and tests.

Additional context

This code:

<Typeset fontSizes={[16, '1rem']} />

Gives us this result: image

And this is almost desirable result

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

2reactions
shilmancommented, Oct 26, 2019

Yippee!! I just released https://github.com/storybookjs/storybook/releases/tag/v5.3.0-alpha.30 containing PR #8574 that references this issue. Upgrade today to try it out!

You can find this prerelease on the @next NPM tag.

Closing this issue. Please re-open if you think there’s still more to do.

0reactions
domyencommented, Oct 25, 2019

Absolutely, definitely open to a PR!

On Fri, Oct 25, 2019 at 12:45 PM Kirill Popolov notifications@github.com wrote:

Anyway, I’d like to make necessary changes if it’s ok.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/storybookjs/storybook/issues/8568?email_source=notifications&email_token=AACAJWICMF5SJPQG6W7EYKLQQMPCZA5CNFSM4JFAEPVKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOECI5CZI#issuecomment-546427237, or unsubscribe https://github.com/notifications/unsubscribe-auth/AACAJWKAJO3CKQZFYOBOFILQQMPCZANCNFSM4JFAEPVA .

Read more comments on GitHub >

github_iconTop Results From Across the Web

siunitx - Proper way to typeset units such as N/m when using ...
Yes, you are using siunitx correctly by giving it literal input, but using unit macros will let you use more features of the...
Read more >
The very short guide to typesetting with LATEX
LATEX is a document preparation system for the TEX typesetting program. ... Use the toolbar buttons or menu items in your editor to...
Read more >
siunitx – A comprehensive (SI) units package - TeXDoc
The siunitx package aims to provide a unified method for LATEX users to typeset numbers and units correctly and easily.
Read more >
4.6: Effective Document Design – Communication at Work
Fortunately, writers can use document templates that make those design choices for them with established styles so that writing a document becomes a...
Read more >
Typesetting - Wikipedia
"Text formatting" redirects here. For other uses, see Formatted text. "Booksetting" redirects here. For a multi-volume work, see Bookset.
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