Add scroll padding

This commit is contained in:
Eric
2026-10-30 17:00:12 +01:00
parent 03bb8c1006
commit b7a687b9f5
3 changed files with 20 additions and 4 deletions
@@ -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
@@ -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;
+1 -1
View File
@@ -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,`);
});