Repository navigation
feat(client): add active slide CSS class - #2870
Open
code-jatin0112 wants to merge 1 commit into
Open
code-jatin0112 wants to merge 1 commit into
code-jatin0112 wants to merge 1 commit into
Conversation
👷 Deploy request for slidev pending review.Visit the deploys page to approve it
|
code-jatin0112
marked this pull request as ready for review
November 25, 2026 11:30
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #2835
Note
Maintainer confirmation on #2835 is still pending. This PR is submitted for review and feedback.
Summary
Adds a reactive
slidev-page-activeCSS class to the currently active slide inside#slideshowwithout changing existing slide visibility (v-show), layout, or transition behavior.Implementation
packages/client/internals/SlidesShow.vue: Added:class="{ 'slidev-page-active': route === currentSlideRoute }"to<SlideWrapper>inside#slideshow.SlidesShow.vuerather thanSlideWrapper.vueso the active class tracks slideshow playback (currentSlideRoute) without leaking onto non-slideshowSlideWrapperinstances such as overview thumbnails (/overview, QuickOverview), Presenter Next previews (including when sharing the same slide number across pending clicks), or standalone/printand/exportframes.cypress/e2e/examples/basic.spec.ts: Added two E2E regression tests verifying:.slidev-page-activeexclusively to the currently visible slide across forward/backward navigation and preserves it acrossv-clicksteps.docs/custom/directory-structure.md&docs/guide/animations.md: Documented.slidev-page-activeunder Targeting the Active Slide and cross-referenced it from the animations guide.Verification
pnpm exec cypress run): 23/23 tests passing across all 5 specs (base-path,basic,iframe-layout,presenter-resizer,smoke), including the 2 new regression tests incypress/e2e/examples/basic.spec.ts.pnpm exec eslinton the 4 changed files): passed (0 errors, 0 warnings).pnpm build): passed (5/5tasks after the code and test edits; subsequent edit was docs-only).v-click, custom CSS.slidev-page-activestyling, Overview, Presenter,/export, and/2?print=truewith zero console errors.pnpm verifyhalted atpnpm typecheckon a pre-existing type error intest/title-renderer-hmr.test.ts:77:67.pnpm test --run(run after code/test changes): 388 passed, 1 pre-existing PlantUML snapshot mismatch inpackages/slidev/node/syntax/integration.test.ts:110.pnpm linthits pre-existing errors in untouched files.Checklist