themes-noir/templates/noir/default.ninjatpl
Alex Dunmow 0b3013ce81 fix(theme): drive responsive layout from theme-owned CSS
Host Tailwind JIT does not scan theme templates, so responsive grid/hero
utilities (sm:/md:/lg:grid-cols-*, min-h-screen, arbitrary values) are
dropped and multi-column layouts collapse to one column. Ship the
load-bearing responsive layout as compiled theme CSS and point the
override templates at it. Layout only — colours stay on semantic tokens.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-05 17:40:19 +08:00

34 lines
1.8 KiB
Plaintext

<!doctype html>
<html lang="en" class="{% if theme_mode == "dark" %}dark{% endif %}">
{{ head_html|safe }}
<body class="bg-background text-foreground antialiased min-h-screen flex flex-col noir-body">
{{ admin_banner_html|safe }}
<header class="w-full">
<div class="max-w-5xl mx-auto px-4">{{ slots.header|safe }}</div>
</header>
<main class="flex-grow w-full">
<div class="max-w-3xl mx-auto w-full px-4 py-12 noir-reveal">
{% if slots.main %}{{ slots.main|safe }}{% else %}<div class="py-20 text-center"><p class="noir-label" style="color:hsl(var(--muted-foreground));">No content blocks assigned to this page.</p></div>{% endif %}
</div>
</main>
<footer class="w-full mt-auto noir-rule">
<div class="max-w-5xl mx-auto px-4">{{ slots.footer|safe }}</div>
</footer>
{{ body_end_html|safe }}
<script>
(function(){
if(window.__noirReveal)return;window.__noirReveal=1;
document.documentElement.classList.add('noir-js');
var reduce=window.matchMedia&&window.matchMedia('(prefers-reduced-motion: reduce)').matches;
var els=document.querySelectorAll('.noir-reveal');
if(reduce||!('IntersectionObserver' in window)){els.forEach(function(el){el.classList.add('noir-in');});return;}
var io=new IntersectionObserver(function(entries){entries.forEach(function(e){if(e.isIntersecting){e.target.classList.add('noir-in');io.unobserve(e.target);}});},{threshold:0,rootMargin:'0px 0px -8% 0px'});
function showAll(){els.forEach(function(el){el.classList.add('noir-in');});}
els.forEach(function(el){var r=el.getBoundingClientRect();var h=window.innerHeight||document.documentElement.clientHeight||0;if(r.top<h*0.92&&r.bottom>0){el.classList.add('noir-in');}else{io.observe(el);}});
window.addEventListener('load',showAll);
setTimeout(showAll,1600);
})();
</script>
</body>
</html>