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

combine this with rem sizing units for font and padding -- now you're playing with power



How about ch units? Heard someone mention it recently and am curious if people are using it. There is often a need to confine a layout to a certain amount of characters and it seems that this unit is better than rem/em for those cases. I would think there's a way to combine em, rem and ch to make some robust layouts.


Also, size your root element font using vw or vh. Then things become really responsive when done right.


Please don't do this. Just because I've got a large viewport, it doesn't mean I want massive text, and just because I've got a small viewport, it doesn't mean I want tiny text. Either extreme can result in very frustrating to read and potentially inaccessible text. Perhaps it makes sense in some narrow cases (e.g. the main page title), but certainly not for your body copy.


With calc() you can get some pretty decent scaling based on vw. If it was just a direct proportion of vw, then yes, things may look a bit on the larger side on a bigger screen, but as with a lot of things, if used with care, the results are pretty nice.


It's not something that would be done as the only thing that influences the final fonts size. As another comment pointed out, it could be combined with calc(). But also, within media queries, to achieve reasonable results in various widths while still responding in a subtle way to the actual viewport with of the client.


Not only power. It's a nice trick for non-designers to create nice looking designs. But you have to keep in mind to use only 2 or 3 sizes of padding and margin. For example: 0.25rem, 0.5rem and 1 rem.




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

Search: