Hacker News new | past | comments | ask | show | jobs | submit login

Or, another option, using rem for font-sizes that bases the size off the font-size of the html element.



That solves a different problem. REM is useful for making the value relative to a master value; v-units make the value relative to the viewport.

I actually use the two in conjunction. I set some my html {font-size: 1.2vw;} (or whatever), and all type in the document to 1rem (or whatever measurement). Then I finally step out the html size to major browser breakpoints using old-fashioned media queries.


cool, do you have any examples of yours you can share?


I can’t share my recent stuff because it’s still under private development, but here’s the results of my first experiments in this method, a little rough around the edges but etc.

http://midcenturymay.nyc

The "master" type size is set to a vh unit, everything else is rem’d off that, and stepped via media query.


Masterful, I love it. I can see how you broke this down and it simplifies things a great deal.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: