Skip to content

Commit 5ea0340

Browse files
authored
removes the padding right when there is no scroll active. (#369)
1 parent 7190f4a commit 5ea0340

File tree

3 files changed

+14
-2
lines changed

3 files changed

+14
-2
lines changed

resources/css/pulse.css

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,16 @@
55
[x-cloak] {
66
display: none;
77
}
8+
9+
@keyframes detect-scroll {
10+
from, to { --can-scroll: ; }
11+
}
12+
13+
@supports selector(::-webkit-scrollbar) {
14+
.supports-scrollbars {
15+
animation: detect-scroll linear;
16+
animation-timeline: scroll(self);
17+
18+
padding-right: var(--can-scroll) theme('spacing.3');
19+
}
20+
}

resources/views/components/scroll.blade.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
}"
2323
{{ $attributes->merge(['class' => '@container/scroll-wrapper flex-grow flex w-full overflow-hidden' . ($expand ? '' : ' basis-56'), ':class' => "loading && 'opacity-25 animate-pulse'"]) }}
2424
>
25-
<div x-ref="content" class="flex-grow basis-full overflow-y-auto scrollbar:w-1.5 scrollbar:h-1.5 scrollbar:bg-transparent scrollbar-track:bg-gray-100 scrollbar-thumb:rounded scrollbar-thumb:bg-gray-300 scrollbar-track:rounded dark:scrollbar-track:bg-gray-500/10 dark:scrollbar-thumb:bg-gray-500/50 supports-scrollbars:pr-3" @scroll.debounce.5ms="scroll">
25+
<div x-ref="content" class="flex-grow basis-full overflow-y-auto scrollbar:w-1.5 scrollbar:h-1.5 scrollbar:bg-transparent scrollbar-track:bg-gray-100 scrollbar-thumb:rounded scrollbar-thumb:bg-gray-300 scrollbar-track:rounded dark:scrollbar-track:bg-gray-500/10 dark:scrollbar-thumb:bg-gray-500/50 supports-scrollbars" @scroll.debounce.5ms="scroll">
2626
{{ $slot }}
2727
<div x-ref="fade" class="h-6 origin-bottom fixed bottom-0 left-0 right-0 bg-gradient-to-t from-white dark:from-gray-900 pointer-events-none" wire:ignore></div>
2828
</div>

tailwind.config.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ module.exports = {
3333
require("@tailwindcss/container-queries"),
3434
function ({ addVariant }) {
3535
addVariant('default', 'html :where(&)')
36-
addVariant('supports-scrollbars', '@supports selector(::-webkit-scrollbar)'),
3736
addVariant('scrollbar', '&::-webkit-scrollbar')
3837
addVariant('scrollbar-track', '&::-webkit-scrollbar-track')
3938
addVariant('scrollbar-thumb', '&::-webkit-scrollbar-thumb')

0 commit comments

Comments
 (0)