Roll Your Own CSS-in-JS Library (1) - Introduction
Sunday, March 7, 2021
CSS-in-JS is an idea to tackle various issues with CSS by writing them in JavaScript (or whatever else that can compile to JavaScript, such as TypeScript). Some popular examples include libraries like styled component , emotion and JSS .
I originally started this series to document some of my experiments with CSS-in-JS, but it later turned out to be a fun investigation project. In total, this series will cover
The basic idea of run-time static CSS-in-JS (this post) The basic idea of run-time dynamic CSS-in-JS Run-time dynamic CSS-in-JS with CSS variables An extremely simplified approach to build-time CSS-in-JS A simple approach to implementing tagged template based CSS-in-JS Please note that this series focus on the high level ideas with a simple demo, so expect to notice a lot of missing features.…