I wasted a day on CSS selector performance to make a website load 2ms faster | Trys Mudford
Picture me holding Trys back and telling him, “Leave it alone, mate, it’s not worth it!”
This
will-change
property that was intended to SOLVE problems for animators may end up doing the opposite.It seems wise for the browsers to step back and let the spec authors fill in the implementation details and gain consensus before moving forward.
Picture me holding Trys back and telling him, “Leave it alone, mate, it’s not worth it!”
Hallelujah! We’re finally getting our two wishes for CSS animations and transitions:
- Animating to and from
display: none;
for the sake of enter/exit animations.- Animating to and from the intrinsic size of an element (such as
height: auto;
).
It would be much harder for a 15-year-old today to View Source and understand the code structure that built the website they’re on. Every site is layered with analytics, code snippets, javascript plugins, CMS data, and more.
This is why the simplicity of HTML and CSS now feels like a radical act. To build a website with just these tools is a small protest against platform capitalism: a way to assert sustainability, independence, longevity.
With classes, we can send CSS static values but with custom properties we can send dynamic ones, which is a major shift in the way we can style state. This is something that has been true for some time—and is extremely well supported—but sometimes it takes solving a small real-world problem to make you appreciate the value of it.
I think we still haven’t come to fully appreciate the superpower of custom properties: dynamic values that are shared between CSS and JavaScript.
Improving performance with containment.
Browsers and bugs.
Trying to understand a different mindset to mine.
Excellent as always.
Also, tipblogging.