From cf80a0771067a0d896fae7eaf046d782ec25e2c2 Mon Sep 17 00:00:00 2001 From: Anthony Fu Date: Sat, 24 Feb 2024 22:30:50 +0100 Subject: [PATCH] feat: support `forward:` and `backward:` variant in UnoCSS for direction-based styling --- packages/client/internals/SlideContainer.vue | 8 +++++--- packages/client/internals/SlidesShow.vue | 6 ++++-- packages/client/uno.config.ts | 8 ++++++++ 3 files changed, 17 insertions(+), 5 deletions(-) diff --git a/packages/client/internals/SlideContainer.vue b/packages/client/internals/SlideContainer.vue index a5870936f9..0101205e83 100644 --- a/packages/client/internals/SlideContainer.vue +++ b/packages/client/internals/SlideContainer.vue @@ -3,7 +3,7 @@ import { provideLocal, useElementSize, useStyleTag } from '@vueuse/core' import { computed, ref, watchEffect } from 'vue' import { configs, slideAspect, slideHeight, slideWidth } from '../env' import { injectionSlideScale } from '../constants' -import { isPrintMode } from '../logic/nav' +import { isPrintMode, navDirection } from '../logic/nav' const props = defineProps({ width: { @@ -55,6 +55,8 @@ const style = computed(() => ({ const className = computed(() => ({ 'select-none': !configs.selectable, + 'slidev-nav-go-forward': navDirection.value > 0, + 'slidev-nav-go-backward': navDirection.value < 0, })) if (props.isMain) { @@ -69,8 +71,8 @@ provideLocal(injectionSlideScale, scale as any)