Notes From âIn And Out Of Styleâ
I watched Jeremyâs talk at CSS Day 2022 titled âIn And Out Of Styleâ and, as always, I had my notepad ready. Here are a few points that stood out to me.
Itâs been said the goal of a good web framework is to one day not exist. Jeremy summarizes this in his statement about jQuery:
Why do we not need jQuery anymore? Because of jQuery.
Todayâs frameworks are the R&D department of the web. Todayâs questions are answered in todayâs library APIs. Yesterdayâs questions are answered in yesterdayâs library APIsâand todayâs platform APIs.
A good framework is like a polyfill. A library abstraction might create a new, programmatic API. Because that API doesnât yet exist in browsers, a polyfill can be created which allows you to write future code today. âUnder the hoodâ the polyfill will use existing web platform APIs to create the desired outcome. This is a programmatic polyfill, but thereâs more than that.
I think there are also conceptual polyfills. Many programmatic polyfills start out this way. Before we understand what the API needs to be, we have to come to understand what the code should do. This is a complex, nuanced process. Jeremy illustrates this well when he covers the history and evolution of CSS, showing how there were early ideas of accounting for user preference in CSS APIs (h1.font.size = 24pt 100%
) which have evolved into some of the APIs we have today (@media prefers-*
). I even think methodologies like BEM can be a kind of conceptual polyfill that points us to uncovering future ways of building on the web.[1]
Frameworks can point the way to a shared context in the future but they themselves are not the future...Use frameworks and libraries as scaffolding to help you build. They are not a foundation. Web standards in the browser are the foundation to build upon.
I like this framing and itâs what I find so exciting about some of the newer abstractions like Remix and Deno which seek to start with web platform APIs and principles as their foundations for building. They start by asking: does this abstraction already exist, in some form or fashion, in the web platform?[2] They look to fill the gaps of the platform and extend it (along the grain of its principles), rather than reinvent anew its foundations.
I really like Jeremyâs final idea about âpath dependenceâ: how our decisions now shape the future. To understand it, just look at how much your present is shaped by the arbitrary decisions of the past.
Yes, the present moment is a result of decisions made in the pastâmany of those arbitrary decisions. But that also means the future will be hugely influenced by the decisions you make today, even if those decisions seems small and inconsequential.
The decisions you make now are the futureâs âpath dependenceâ. Youâre inventing the future one decision at a time.