You want…

I’ve been enjoying these little “You want…” style posts. Post titles like that are a little more… forceful for my normal taste, but I like the spirit of sharing a best practice that perhaps isn’t well-known-enough.

Killian started it with

The post You want… appeared first on CSS-Tricks. You can support CSS-Tricks by being an MVP Supporter.

https://css-tricks.com/you-want/

4y | CSS tricks
Things You Can Do With CSS Today

Some nice coverage from Andy about CSS things that are truly new. If you haven’t looked at new things in CSS in, say, a year, I’d bet pretty much all of this will be new to you. A lot of …

The post Things You Can Do With CSS Today appeared first on CSS-Tricks. You can support CSS-Tricks by being an MVP Supporter.

https://www.smashingmagazine.com/2021/02/things-you-can-do-with-css-today/

4y | CSS tricks
CSS Switch-Case Conditions

CSS is yet to have a switch rule or conditional if, aside from the specific nature of @media queries and some deep trickery with CSS custom properties. Let’s have a look at why it would be useful if we …

The post CSS Switch-Case Conditions appeared first on CSS-Tricks. You can support CSS-Tricks by being an MVP Supporter.

https://css-tricks.com/css-switch-case-conditions/

4y | CSS tricks
Use CSS Clamp to create a more flexible wrapper utility

I like Andy’s idea here: .wrapper { width: clamp(16rem, 90vw, 70rem); margin-left: auto; margin-right: auto; padding-left: 1.5rem; padding-right: 1.5rem; } Normally I’d just set a max-width there, but as Andy says:

This becomes a slight issue in mid-sized viewports, such

The post Use CSS Clamp to create a more flexible wrapper utility appeared first on CSS-Tricks. You can support CSS-Tricks by being an MVP Supporter.

https://piccalil.li/quick-tip/use-css-clamp

4y | CSS tricks
Maximally optimizing image loading for the web in 2021

Malte Ubl’s list for:

8 image loading optimization techniques to minimize both the bandwidth used for loading images on the web and the CPU usage for image display.

Fluid width images in CSS, not forgetting the height and width attributes

The post Maximally optimizing image loading for the web in 2021 appeared first on CSS-Tricks. You can support CSS-Tricks by being an MVP Supporter.

https://www.industrialempathy.com/posts/image-optimizations/

4y | CSS tricks
How to Create a Shrinking Header on Scroll Without JavaScript

Imagine a header of a website that is nice and thick, with plenty of padding on top and bottom of the content. As you scroll down, it shrinks up on itself, reducing some of that padding, making more screen real …

The post How to Create a Shrinking Header on Scroll Without JavaScript appeared first on CSS-Tricks. You can support CSS-Tricks by being an MVP Supporter.

https://css-tricks.com/how-to-create-a-shrinking-header-on-scroll-without-javascript/

4y | CSS tricks
The web didn’t change; you did

I love this piece from Remy Sharp where he argues that the web didn’t get more complicated over the last 20 years, despite what we might think:

Web development did not change. Web development grew. There are more options now,

The post The web didn’t change; you did appeared first on CSS-Tricks. You can support CSS-Tricks by being an MVP Supporter.

https://remysharp.com/2021/02/11/the-web-didnt-change-you-did

4y | CSS tricks
Netlify

High five to Netlify for the ❥ sponsorship. Netlify is a great place to host your static (or not-so-static!) website because of the great speed, DX, pricing, and feature set. I’ve thought of Netlify a bunch of times just in …

The post Netlify appeared first on CSS-Tricks. You can support CSS-Tricks by being an MVP Supporter.

https://css-tricks.com/netlify-2/

4y | CSS tricks
Using AbortController as an Alternative for Removing Event Listeners

The idea of an “abortable” fetch came to life in 2017 when AbortController was released. That gives us a way to bail on an API request initiated by fetch() — even multiple calls — whenever we want. Here’s a super …

The post Using AbortController as an Alternative for Removing Event Listeners appeared first on CSS-Tricks. You can support CSS-Tricks by being an MVP Supporter.

https://css-tricks.com/using-abortcontroller-as-an-alternative-for-removing-event-listeners/

4y | CSS tricks
Beautiful accessibility with Floating Focus

Imagine if your :focus styles animated from element to element as you tab through a site. Like the focus ring up and flew across the page to the next element. The spirit of it is similar to smooth scrolling: it’s …

The post Beautiful accessibility with Floating Focus appeared first on CSS-Tricks. You can support CSS-Tricks by being an MVP Supporter.

https://github.com/Q42/floating-focus-a11y

4y | CSS tricks

Search