Remove when-is-it-right-to-reach-for-contain-and-will-change-in-css
article thumbnail

When is it “Right” to Reach for contain and will-change in CSS?

CSS - Tricks

I’ve got some blind spots in CSS-related performance things. One example is the will-change property. You’re telling the browser some particular property (or the scroll-position or content) uh, will , change: el { will-change: opacity; }.el.additional-hard-to-know-state table { contain: strict; }.

Speed 60
article thumbnail

The Ultimate Low-Quality Image Placeholder Technique

CSS Wizardry

The median image-weight per page landed at 881KB in 2022 , which is more than HTML, CSS, JS, and fonts combined! And while images do not block rendering (unless you do something silly ), it’s important to consider how we offer a reasonably pleasant experience while users are waiting for images to load. The solution?

Games 275
Insiders

Sign Up for our Newsletter

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Trending Sources

article thumbnail

Reducing The Need For Pseudo-Elements

Smashing Magazine

Per the W3C spec , “a pseudo-element represents an element not directly present in the document tree” They have been around since version 1 of the CSS specification, when ::first-letter and ::first-line were introduced. selection is another pseudo-element many reach to. Reducing The Need For Pseudo-Elements. Marcel Moreau.

Internet 135
article thumbnail

Increase the Performance of your Site with Lazy-Loading and Code-Splitting

Jos

A small component to detect visibility : A simple component that wraps the logic to notify when an element appears on screen. Polyfilling IntersectionObserver on-demand : How we can include a polyfill only when needed. Code Splitting and CSS-in-JS : How CSS-in-JS extends code-splitting and lazy-loading to CSS, SVGs and other resources.

Code 147
article thumbnail

The Humble ` ` Element And Core Web Vitals

Smashing Magazine

Use CSS aspect-ratio or aspect ratio boxes to reserve space otherwise. For low impact to First Input Delay : Avoid images causing network contention with other critical resources like CSS and JS. E.g. LCP measures when the largest contentful element (images, text) in a user’s viewport, such as one of these images, becomes visible.

Media 145
article thumbnail

How We Improved SmashingMag Performance

Smashing Magazine

A day when a project, fully polished and carefully optimized, gets launched, ranking high and soaring above performance scores in Lighthouse and WebPageTest. Every web performance story is similar, isn’t it? It always starts with the long-awaited website overhaul. We’ve been there at Smashing as well. This is where we started.

article thumbnail

A Guide To Image Optimization On Jamstack Sites

Smashing Magazine

But what happens when we all start creating content on a massive scale, filling the web with more and more data, and storing hundreds of zettabytes of content? It is clear that when we think of content, the first thing that comes to mind is text. A Guide To Image Optimization On Jamstack Sites. Alba Silvente. 2022-11-17T10:00:00+00:00.

Media 105