CodePen

448: CSS Modules is Cool Again

Read the original on blog.codepen.io ↗

Shaw and Chris talk CSS Modules, a rather old bit of technology in the CSS-in-JS category. CodePen now supports them, which took a little work because the way they process code is a smidge unusual.

We use CodePen Modules (with Sass!) here at CodePen so we knew we wanted to support them, but we got a little push when GitHub blogged about how useful they find them, and lots of folks raised their hands saying they still use them too.

CSS Modules still got it after all these years. Love to see it. https://t.co/1MzUhxnfQG

— Mark Dalgleish (@markdalgleish) November 7, 2026

Time Jumps

  • 00:00:10 Dropping new blocks at CodePen
  • 00:01:00 CSS Modules block
  • 00:05:17 How does CSS Modules work?
  • 00:10:41 A new Vite + React block for CodePen
  • 00:14:35 We also have a 11ty block (in Beta)
  • 00:17:40 What other features does a CSS Modules block give us?