Blog
Mert Özen's blog posts on software development, backend, frontend, and DevOps.
Theming with Sass: Maps, Generating CSS Custom Properties, Dark Mode and an Angular Material M3 Theme
Keep theme values in a Sass map, validate them and turn them into custom properties with light-dark(); switching themes at runtime means changing only color-scheme or a class on html, because Sass variables never change at runtime. We add a mixin that fails the build on a missing token, a three-state theme button and an Angular Material M3 theme generated from the brand color to Bookstore, measure eight states across two themes, and show why one bundle per theme is not worth it.
Component Harnesses: Using CDK Harnesses, Writing Your Own and Decoupling Tests from Markup
A component harness puts an API between the test and the DOM: when the markup changes, only the harness changes, not the tests. On Bookstore we show Angular Material's select and dialog harnesses, documentRootLoader and the animation setting, our own harness with HarnessPredicate for RatingInput, and when to choose a harness or Testing Library, all with real runs.