From b7a687b9f54ba4385312e465bb8ef5e18b6e27d0 Mon Sep 17 00:00:00 2001 From: Eric Date: Fri, 30 Oct 2026 17:00:12 +0100 Subject: [PATCH] Add scroll padding --- .../sponsor/SponsorHeroAnimation.vue | 1 - .../theme/components/sponsor/SponsorTiers.vue | 21 +++++++++++++++++-- docs/scripts/writeIconMetaIndex.mts | 2 +- 3 files changed, 20 insertions(+), 4 deletions(-) diff --git a/docs/.vitepress/theme/components/sponsor/SponsorHeroAnimation.vue b/docs/.vitepress/theme/components/sponsor/SponsorHeroAnimation.vue index 9e7821761..5927eb2ba 100644 --- a/docs/.vitepress/theme/components/sponsor/SponsorHeroAnimation.vue +++ b/docs/.vitepress/theme/components/sponsor/SponsorHeroAnimation.vue @@ -60,7 +60,6 @@ const showHandles = ref(true); // motion-v passes the variant label that finished, not the resolved variant const onAnimationComplete = (variant: unknown) => { if (variant === 'visible') drawAnimation.value = 'exit'; - if (variant === 'exit') showHandles.value = false; }; // Only rendered on the client, so reduced motion is known before the first frame diff --git a/docs/.vitepress/theme/components/sponsor/SponsorTiers.vue b/docs/.vitepress/theme/components/sponsor/SponsorTiers.vue index 6ba921c01..da3f6b271 100644 --- a/docs/.vitepress/theme/components/sponsor/SponsorTiers.vue +++ b/docs/.vitepress/theme/components/sponsor/SponsorTiers.vue @@ -179,6 +179,9 @@ function scrollTrack(direction: 1 | -1) { padding-right: 24px; scroll-padding-right: 24px; scrollbar-width: thin; + scroll-snap-align: center; + scroll-padding-left: 24px; + scroll-padding-right: 24px; } .track:focus-visible { @@ -202,16 +205,30 @@ function scrollTrack(direction: 1 | -1) { .fade-left { left: 0; - width: 96px; + width: 48px; background: linear-gradient(to left, transparent, var(--vp-c-bg)); } .fade-right { right: 0; - width: 160px; + width: 48px; background: linear-gradient(to right, transparent, var(--vp-c-bg) 85%); } +@media (min-width: 640px) { + .fade-left { + width: 96px; + } + + .fade-right { + width: 160px; + } + + .track { + scroll-snap-align: start; + } +} + .partner { padding: 24px 28px; border-radius: 16px; diff --git a/docs/scripts/writeIconMetaIndex.mts b/docs/scripts/writeIconMetaIndex.mts index 2a86f73ec..927707101 100644 --- a/docs/scripts/writeIconMetaIndex.mts +++ b/docs/scripts/writeIconMetaIndex.mts @@ -19,7 +19,7 @@ iconJsonFiles.forEach((iconJsonFile) => { const iconName = path.basename(iconJsonFile, '.json'); iconMetaIndexFileImports.push( - `import ${toCamelCase(iconName)}Metadata from '../../../icons/${iconName}.json';`, + `import ${toCamelCase(iconName)}Metadata from '../../../icons/${iconName}.json' with { type: 'json' };`, ); iconMetaIndexFileExports.push(` '${iconName}': ${toCamelCase(iconName)}Metadata,`); });