@@ -55,9 +55,21 @@
var grid = document.getElementById('theme-grid');
var cards = {};
+ // #132: midnight is dark-first (root preset = midnight = dark; its light
+ // variant is midnight-light), the others are light-first. Resolve the
+ // LIGHT and DARK preset ids generically so the light swatches always
+ // render in the top row of every card.
+ function lightPreset(id) {
+ if (id === 'midnight') return 'midnight-light';
+ return id; // light-first bases use themselves as the light variant
+ }
+ function darkPreset(id) {
+ if (id === 'midnight') return 'midnight'; // root preset is midnight's dark
+ return id + '-dark';
+ }
pairs.forEach(function (t) {
- var light = presetColors(t.id);
- var dark = presetColors(t.id + '-dark');
+ var light = presetColors(lightPreset(t.id));
+ var dark = presetColors(darkPreset(t.id));
var btn = document.createElement('button');
btn.type = 'button';
btn.className = 'theme-card';