Hacker News new | ask | show | jobs
by autoexec 717 days ago
> I'm constantly amazed by how much can be achieved with only CSS nowadays.

Honestly it's a bit too much. CSS is used for fingerprinting and exploits. It's become a security risk to have it enabled and I think before long we'll want CSS blockers the same way we have blockers for JS. The ability to allow only sane subset of CSS would be really useful!

3 comments

I've been longing for the ability to disable media queries. Just serve me the default.

It's not only useful against fingerprinting, but also when the creator's idea of what layout is appropriate on my setup differs from mine.

Modern responsive design can do away with almost 100% of media queries. I used one single media query for one element after spending several days trying to write formulas to handle a weird edge case. I dislike media queries.
Did not try it out, but an idea: write a user script that changes the <meta viewport>.

See https://developer.mozilla.org/en-US/docs/Web/HTML/Viewport_m... what this meta tag does.

You might be pretty disappointed by the defaults in many cases: it’s extremely common to start with styles for the smallest viewports (“mobile”) and use media queries to add larger viewport variants. I don’t know if you’re among the same people who complain about the overuse of mobile UI techniques on larger screens/devices, but that’s almost certainly what you’d get more of in general.
One way around it is to do what the Tor Browser does: report an arbitrary value.
That's a good point. At the same time, I believe it can make a lot of sense, particularly if it is used to implement functionality that was previously implemented in JavaScript.

Given that CSS is not an actual programming language, browser vendors can optimize it in ways that JavaScript can't. This extra optimization is a big benefit in the world of mobile devices and batteries.

Frontend devs in 2000: "Why can't we do grid layouts?!"

In 2020: "Grid is too much!" :)

Anchors in general are great, and they can be abused. Just like how we abused `transform` to vertically center things before flexbox.