A blog about web development, HTML, CSS, JavaScript, and web accessibility.

Day 43: grouping layers

Cascade layers can be grouped by nesting layer rules.

Day 42: aspect-ratio

Yes, I know, aspect-ratio is not the hottest shit, but Safari only starting supporting it in version 15 and there’s a lot I didn’t know about the property. That’s reason enough for me to write about it. :)

Day 41: custom properties and url()s

Let’s say you want to swap the background image of an element based on a certain condition, like whether it’s pressed, using custom properties.

Day 40: unlayered styles

On day 37 we learned that we can get more control over specificity by creating layers. That first, simple example is pretty straightforward, but what happens if we mix layered and unlayered styles?

Day 39: comma-separated functional color notations

On day 11 I've introduced you to space-separated functional color notations. Early color functions like rgb() and hsl() support both the old comma-separated and the new space-separated syntax.

Day 38: vh, svh, lvh, and dvh

Using the viewport unit vh in desktop browsers is usually straight-forward, 100vh matches the height of the viewport. On mobile that's different because the viewport height changes depending on whether or not certain user interface elements are visible, 100vh doesn't always match the height of the viewport.

Day 37: cascade layers

Cascade layers introduce a new way of managing specificity in CSS.

Day 36: :has() and pseudo-elements

We already know that we can select an element based on the presence of a certain child element (in Chrome/Edge 105+ and Safari 15.4+), but there are limitations.

Day 35: forgiving selectors

There's a difference between listing selectors in :where(), :is(), and :has() and listing them in a regular selector list.

Day 34: :is() or :where()

Thoughts on when it’s better to use :is() over :where() and vice versa.