Add Opacity to an Existing Color (by Chris Coyier)
Applying opacity to an existing colour value is a pretty common design requirement, and here Chris presents five ways to achieve it.
Fuzzy Logic show (April 23), Radio Buena Vida
My latest radio show is dedicated to Ryuichi Sakamoto, who sadly died recently. I played a couple of tracks by the great man alongside more of my favourite music.
W3C and Smart Interface pattern websites
Two lovely new websites (or website updates) appeared on my radar this last week that I wanted to note here for future front-end inspiration.
Vitaly Friedman’s Smart Interface Patterns has had some lovely animation and component work from Clearleft alumni Cassie Evans and Trys Mudford. Given Vitaly’s obsession with creating accessible, user-friendly components and the collaborators he has on board, I expect this site to be choc-full of well crafted nuggets for reference! It looks ace, too.
I noted a while ago that the W3C had a new Design System, and now the W3C has a new website in beta too. I imagine it might use components from that Design System alongside other carefully-considered patterns of markup, style and behaviour.
Nice job on these sites, to all concerned!
First play with CSS Container Queries
In responsive design we generally want a single component to get different styles in different contexts. Up until recently the prevailing method of context-awareness was to use a CSS media query to query the viewport size. This wasn’t ideal. For example you might want an component to be styled differently when in a narrow context such as a sidebar (regardless of the device size), and viewport-based queries don’t help with that.
But everything has changed. We can now use CSS to query the size of any given container and this feature is supported in all major browsers.
There’s a bit of new syntax to learn, so I recently had my first play with container queries on codepen.
My pen is pretty trivial, but the goal was specifically to do the most minimal test that lets me test-drive the key syntax. It turns out that it’s quite straightforward.
Define an element as a container:
Change the styles of another element (
.foo) when it’s inside that container and the container’s inline-size (the logical property name for
width) matches a given query:
Note that you could also omit the
ctr-sidebar context in the above query, if you wanted the change to apply in all defined containers.
Collaboration versus handoff, and avoiding broken promises
I’m a fan of web designers and developers collaborating closely rather than designers throwing mock-ups over the wall. Recently I read two newsletters relating to this topic, or perhaps more accurately about perceived divisions between design and development and some better, more modern ways of thinking.
The new HTML search element
My work colleague Ryan recently drew my attention to the new HTML
search element. This morning I read Scott O’Hara’s excellent primer. Scott worked on implementing
<search>, and his article cleared up my questions around what it is and when we can start using it.
Fuzzy Logic show (March 23), Clyde Built Radio
I recorded my second radio show of 2023 live at the Clyde Built Radio studio at the weekend. It was great playing records there on a sunny Sunday with the clocks just gone forward and the Barras buzzing as it hosted a Hong Kong street market.
Quick circle (by Adam Argyle)
I’m wary of list-based clickbait – and Adam’s recent 6 CSS snippets every front-end developer should know in 2023 feels like that – however I like this modern and minimal approach to creating a circle. I’ve previously seen
aspect-ratio: 1 used to create a square box and it’s a lovely shorthand for “make width and height equal”. It makes sense that you can use it for a circle too, just by adding some
Modern Font Stacks
System font stack CSS organized by typeface classification for every modern OS. The fastest fonts available. No downloading, no layout shifts, no flashes — just instant renders.
5 things I learned working on a design system for a year (by Anda Popovici)
I was delighted to discover that my talented colleague Anda has her own website and uses it to write articles like this! This one is obviously pretty relevant to me too, given that I work on the same team.