389 private links
Colors:
how do we decide where to use custom properties? There are really two cases:
1) whenever we need to use the same value in more than one place (DRY)
2) when we know a value is going to be changed.
Custom Properties:
I already use the css variables methods. They are great. Note we can inline them and avoid a verbose default: var(--btn-color, var(--color-text))
You can think of :has() as a way to query an element about what’s inside it.
This makes our button class very flexible. You can throw about any combination of things inside it, and it will adjust accordingly. Text only, image and text, image only, inputs (like radio buttons), or multiple images with text.
The post of 37signals takes also the sidebar into account. The trigger button can be pure CSS even if the icon in it changes. :has() allow to verify if a button inside an element is disabled too.
Responsive design:
They use one @media breakpoint (max-width: 100ch) for a two column layout.
Using characters as the unit of measure ensures that we get the right behavior no matter which device you’re using and in a number of other scenarios such as multitasking on iPad or even if you simply enlarge the font size past a certain point. Type is the heart of web pages so it makes sense for the layout to respond to it.
Feature enhancements such as hover or touch effects with media queries: @media (any-hover: hover) in combination with (pointer: fine) or (pointer: coarse)
Great stuff and kudos to them 👏