Changeset 9cc0f9f in Klonkt


Ignore:
Timestamp:
06/24/2026 04:49:43 PM (3 months ago)
Author:
Robin Genis <roboburr@…>
Branches:
main
Children:
19fbe03
Parents:
f6c414e
Message:

fix(theme): use the validated palette in the shell (dead palette broke dark/light)

A site stuck on a removed palette (e.g. 'ocean') rendered data-palette with no CSS
block, so the light/dark toggle had nothing to switch. The shell now uses the
whitelist-validated palette local (falls back to klonkt) instead of the raw
site.palette. Existing sites on dead palettes were migrated to klonkt.

Co-Authored-By: Claude <noreply@…>

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/views/shell.ejs

    rf6c414e r9cc0f9f  
    102102}
    103103%><!DOCTYPE html>
    104 <html lang="<%= _e(lang) %>" data-palette="<%= _e(safeSite.palette || 'klonkt') %>">
     104<html lang="<%= _e(lang) %>" data-palette="<%= _e((typeof palette !== 'undefined' && palette) ? palette : (safeSite.palette || 'klonkt')) %>">
    105105<head>
    106106<meta charset="utf-8">
     
    218218    try {
    219219      var siteDefault   = '<%= safeSite.theme_override || "" %>';
    220       var sitePalette   = '<%= safeSite.palette || "klonkt" %>';
     220      var sitePalette   = '<%= (typeof palette !== 'undefined' && palette) ? palette : (safeSite.palette || 'klonkt') %>';
    221221
    222222      // One-time cleanup: drop the orphan pcms-palette key set by P43-P57
Note: See TracChangeset for help on using the changeset viewer.