Skip to content

Create beautiful slides on the web using a coding agent's frontend skills

Fix slide visibility switching

Zara Zhang7f32a266eceb
diff --git a/SKILL.md b/SKILL.md
index d9983dc..9dab180 100644
--- a/SKILL.md
+++ b/SKILL.md
@@ -44,6 +44,7 @@ These invariants apply to EVERY slide in EVERY presentation:
- The stage scales uniformly to fit the viewport. It may letterbox/pillarbox; it must not re-layout content.
- Do not use responsive breakpoints to rearrange slide content for phones.
- Use fixed internal slide measurements at the 1920×1080 design size.
+- Slide visibility must be controlled by `.active` / `.visible` using `visibility`, `opacity`, and `pointer-events` from `viewport-base.css`. Do not use `display: none` / `display: block` for slide switching; later layout classes such as `.slide-content { display: flex; }` can override them and make every slide visible at once.
- Use `clamp()` only for non-slide UI outside the stage, or for small fallback previews where a full stage is impractical.
- Include `prefers-reduced-motion` support
- Never negate CSS functions directly (`-clamp()`, `-min()`, `-max()` are silently ignored) — use `calc(-1 * clamp(...))` instead
diff --git a/plugins/frontend-slides/skills/frontend-slides/SKILL.md b/plugins/frontend-slides/skills/frontend-slides/SKILL.md
index d9983dc..9dab180 100644
--- a/plugins/frontend-slides/skills/frontend-slides/SKILL.md
+++ b/plugins/frontend-slides/skills/frontend-slides/SKILL.md
@@ -44,6 +44,7 @@ These invariants apply to EVERY slide in EVERY presentation:
- The stage scales uniformly to fit the viewport. It may letterbox/pillarbox; it must not re-layout content.
- Do not use responsive breakpoints to rearrange slide content for phones.
- Use fixed internal slide measurements at the 1920×1080 design size.
+- Slide visibility must be controlled by `.active` / `.visible` using `visibility`, `opacity`, and `pointer-events` from `viewport-base.css`. Do not use `display: none` / `display: block` for slide switching; later layout classes such as `.slide-content { display: flex; }` can override them and make every slide visible at once.
- Use `clamp()` only for non-slide UI outside the stage, or for small fallback previews where a full stage is impractical.
- Include `prefers-reduced-motion` support
- Never negate CSS functions directly (`-clamp()`, `-min()`, `-max()` are silently ignored) — use `calc(-1 * clamp(...))` instead
diff --git a/plugins/frontend-slides/skills/frontend-slides/viewport-base.css b/plugins/frontend-slides/skills/frontend-slides/viewport-base.css
index 876ee1c..0b35133 100644
--- a/plugins/frontend-slides/skills/frontend-slides/viewport-base.css
+++ b/plugins/frontend-slides/skills/frontend-slides/viewport-base.css
@@ -43,13 +43,19 @@ body {
width: 1920px;
height: 1080px;
overflow: hidden;
- display: none;
+ display: block;
+ visibility: hidden;
+ opacity: 0;
+ pointer-events: none;
background: var(--slide-bg, #fff);
}
.slide.active,
.slide.visible {
- display: block;
+ visibility: visible;
+ opacity: 1;
+ pointer-events: auto;
+ z-index: 1;
}
/* 5. Keep media inside authored slide bounds */
@@ -97,6 +103,9 @@ svg {
.slide {
position: relative;
display: block !important;
+ visibility: visible !important;
+ opacity: 1 !important;
+ pointer-events: auto !important;
width: 1920px;
height: 1080px;
break-after: page;
diff --git a/viewport-base.css b/viewport-base.css
index 876ee1c..0b35133 100644
--- a/viewport-base.css
+++ b/viewport-base.css
@@ -43,13 +43,19 @@ body {
width: 1920px;
height: 1080px;
overflow: hidden;
- display: none;
+ display: block;
+ visibility: hidden;
+ opacity: 0;
+ pointer-events: none;
background: var(--slide-bg, #fff);
}
.slide.active,
.slide.visible {
- display: block;
+ visibility: visible;
+ opacity: 1;
+ pointer-events: auto;
+ z-index: 1;
}
/* 5. Keep media inside authored slide bounds */
@@ -97,6 +103,9 @@ svg {
.slide {
position: relative;
display: block !important;
+ visibility: visible !important;
+ opacity: 1 !important;
+ pointer-events: auto !important;
width: 1920px;
height: 1080px;
break-after: page;