From eeabb7085503b7952a66a4ace81638acdd5d799f Mon Sep 17 00:00:00 2001 From: navi Date: Mon, 28 Sep 2026 15:40:31 +0200 Subject: [PATCH] fix: scope every rule in a slide's own style block to that slide MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Binding only the `:thisSlide` token still left every untokened rule in a slide's tag compiling deck-wide, so one slide's styles kept applying to all slides. Wrap each slide's whole style block in its section selector instead, with `:thisSlide` resolving to `&` — Less hoists `@keyframes`/ `@font-face` out of the wrapper itself and keeps `@media` nested inside, so only rules end up scoped. The global block stays the shared layer and the deck still compiles exactly once. --- src/main.ts | 14 ++++++++------ src/slides/compile.ts | 36 +++++++++++++++++++++++------------- 2 files changed, 31 insertions(+), 19 deletions(-) diff --git a/src/main.ts b/src/main.ts index 22ae158..bec8e70 100644 --- a/src/main.ts +++ b/src/main.ts @@ -14,15 +14,17 @@ interface Slide { code: string } -// The starter slide opens with a