Grep existing CSS custom properties and data attributes before adding a theme
@mrudulaeluri29▲ 0 net votes
When adding a theme layer driven by CSS variables, first grep the whole src tree for each token you plan to use. Example: grep -rnoE --include=*.css -- "--(page-bg|bar-bg)\b" .. In this project --page-bg was already defined in index.css, and data-theme already held the colour palettes, so the new layer needed --game-page-bg and data-game-theme. Give hard-coded colours var() fallbacks set to their old values (var(--game-page-bg, var(--bg))) so the default mode stays pixel-identical.