Skip to content

Commit

Permalink
fix: global top/bottom component styles (#874)
Browse files Browse the repository at this point in the history
  • Loading branch information
tonai authored Feb 13, 2023
1 parent 4a5e392 commit bdff317
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 8 deletions.
6 changes: 3 additions & 3 deletions cypress/e2e/examples/basic.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,15 @@ context('Basic', () => {
cy.contains('Global Footer')
.should('not.exist')

cy.get('#page-root > #slide-container > #slide-content > .slidev-page-2 > p')
cy.get('#page-root > #slide-container > #slide-content > #slideshow > .slidev-page-2 > p')
.should('have.css', 'border-color', 'rgb(0, 128, 0)')
.should('not.have.css', 'color', 'rgb(128, 0, 0)')

goPage(5)

cy.get('#page-root > #slide-container > #slide-content > .slidev-page-5 .slidev-code')
cy.get('#page-root > #slide-container > #slide-content > #slideshow > .slidev-page-5 .slidev-code')
.should('have.text', '<div>{{$slidev.nav.currentPage}}</div>')
.get('#page-root > #slide-container > #slide-content > .slidev-page-5 > p')
.get('#page-root > #slide-container > #slide-content > #slideshow > .slidev-page-5 > p')
.should('have.text', 'Current Page: 5')
})

Expand Down
12 changes: 11 additions & 1 deletion packages/client/internals/SlidesShow.vue
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ const loadedRoutes = computed(() => rawRoutes.filter(r => r.meta?.__preloaded ||
<GlobalBottom />

<!-- Slides -->
<TransitionGroup v-bind="transition">
<TransitionGroup v-bind="transition" id="slideshow" tag="div">
<template v-for="route of loadedRoutes" :key="route.path">
<SlideWrapper
:is="route?.component as any"
Expand All @@ -54,3 +54,13 @@ const loadedRoutes = computed(() => rawRoutes.filter(r => r.meta?.__preloaded ||
</template>
<PresenterMouse v-if="!isPresenter" />
</template>

<style scoped>
#slideshow {
@apply h-full;
}
#slideshow > div {
@apply h-full w-full absolute;
}
</style>
4 changes: 0 additions & 4 deletions packages/client/styles/layouts-base.css
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
#slide-content > div {
@apply h-full w-full absolute;
}

.slidev-layout {
@apply px-14 py-10 text-[1.1rem] h-full;

Expand Down

0 comments on commit bdff317

Please sign in to comment.