v1.8.11: fix branding colors — inject style overrides for Tailwind classes, sync color picker with hex input
This commit is contained in:
+7
-1
@@ -651,7 +651,13 @@ async function toggleFav(bookId, btn, e) {
|
||||
|
||||
// ── Branding ───────────────────────────────────────────────────────────────
|
||||
fetch('/branding').then(r=>r.json()).then(b=>{
|
||||
if(b.site_name) document.getElementById('brand-name').textContent=b.site_name;
|
||||
if(b.site_name){const bn=document.getElementById('brand-name');if(bn)bn.textContent=b.site_name;}
|
||||
if(b.primary_color || b.secondary_color) {
|
||||
const p=b.primary_color||'#4edea3', s=b.secondary_color||'#95d3ba';
|
||||
const style=document.createElement('style');
|
||||
style.textContent=`.text-primary{color:${p}!important}.bg-primary{background-color:${p}!important}.border-primary{border-color:${p}!important}.text-secondary{color:${s}!important}.bg-secondary{background-color:${s}!important}.hover\\:text-primary:hover{color:${p}!important}.focus\\:border-primary:focus{border-color:${p}!important}`;
|
||||
document.head.appendChild(style);
|
||||
}
|
||||
}).catch(()=>{});
|
||||
|
||||
// ── Auth Nav ───────────────────────────────────────────────────────────────
|
||||
|
||||
Reference in New Issue
Block a user