Hacker News new | ask | show | jobs
by HorstG 2344 days ago
There is CSS media query for exactly your use-case. No need for sniffing, round-trips or any server-side activity at all.
1 comments

a media query will not tell me what OS it is so i can infer the metrics of native fonts and form controls. i would have to use JS and create sentinel elements to make the measurements, which would still be a form of slower, shittier sniffing.

also, a media query or any other client side method prevents me from delivering exactly the final content that's necessary and not have to do additional reflow-inducing js to get the end result.