Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/runtime/components/Drawer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,8 @@ const contentEvents = {

const ui = computed(() => tv({ extend: tv(theme), ...(appConfig.ui?.drawer || {}) })({
direction: props.direction,
inset: props.inset
inset: props.inset,
snapPoints: props.snapPoints && props.snapPoints.length > 0
}))
</script>

Expand Down
14 changes: 14 additions & 0 deletions src/theme/drawer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ export default (options: Required<ModuleOptions>) => ({
true: {
content: 'rounded-lg after:hidden overflow-hidden [--initial-transform:calc(100%+1.5rem)]'
}
},
snapPoints: {
true: ''
}
},
compoundVariants: [{
Expand All @@ -43,13 +46,24 @@ export default (options: Required<ModuleOptions>) => ({
content: 'h-auto max-h-[96%]',
handle: '!w-12 !h-1.5 mx-auto'
}
}, {
direction: ['top', 'bottom'],
snapPoints: true,
class: {
content: 'h-full' }
}, {
direction: ['right', 'left'],
class: {
content: 'w-auto max-w-[calc(100%-2rem)]',
handle: '!h-12 !w-1.5 mt-auto mb-auto'
}
}, {
direction: ['right', 'left'],
snapPoints: true,
class: {
content: 'w-full' }
},
{
direction: 'top',
inset: true,
class: {
Expand Down
Loading