jakobsen / fluid-typography

Find the perfect CSS values for your fluid heading, and control how it scales across different viewport widths.
https://fluid-typography.netlify.app/
MIT License
92 stars 6 forks source link

Feature request: viewport size as variable (now is 1600) #8

Closed dkrnl closed 3 years ago

dkrnl commented 3 years ago

Hi!

https://github.com/jakobsen/fluid-typography/blob/d96afe9eef09afd359decd9e642249fb522b682a/src/components/App.js#L22

Thx!

jakobsen commented 3 years ago

Hello! This magic number (I guess I should store it in a variable so it becomes obvious) follows from the fact that 1vw is equal to 1/100 of the viewport width, and that 1rem defaults to 16px. When working out the equations 1600 is a constant factor independent of viewport size. You can already edit your desired viewport parameters using the input boxes, so I think I might be misunderstanding what you're asking. Could you provide an example? :)

dkrnl commented 3 years ago

Ok! Sorry (: