How can Javascript improve your CSS mixins
summary
Uses PostCSS to replace SASS-style mixins with JS files (example size.js), implements a real postcss plugin that reads declaration.value, uses node.cloneBefore and declaration.remove to emit width/height so original property is stripped, and drives development with unit tests via the provided run helper. The example plugin passes tests after fewer than ten lines of code, can handle multiple values, and is publishable (see postcss-short-size).
AI-written summary · about
chapters (11)
- 0:00Introduction
- 1:20Post CSS
- 6:02Unit Tests
- 7:18My story
- 8:05Testing
- 9:18Web evolution
- 11:07How can you share this
- 13:57Run function
- 15:30Test
- 17:02Publish
- 18:16CSS NGS








