Skip to content

Commit 7733395

Browse files
lolzivkovicmaiieul
andauthored
fix: styled modal alignment (#1104)
* fix: styled modal aligning to either left/top when position set either right/botto * docs: update modal changes --------- Co-authored-by: maiieul <maieul.chevalier@rosa.be>
1 parent dc0561e commit 7733395

File tree

3 files changed

+13
-8
lines changed

3 files changed

+13
-8
lines changed

.changeset/shiny-emus-visit.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@qwik-ui/styled': patch
3+
---
4+
5+
fix: styled modal aligning to either left/top when position set either right/bottom'

apps/website/src/routes/docs/styled/modal/index.mdx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,12 +45,12 @@ export const panelVariants = cva(
4545
position: {
4646
center:
4747
'max-w-lg rounded-base shadow-lg data-[closed]:fade-out data-[open]:fade-in data-[closed]:zoom-out-95 data-[open]:zoom-in-95 data-[open]:slide-in-from-bottom-2 backdrop:data-[closing]:fade-out backdrop:data-[open]:fade-in',
48-
top: 'inset-x-0 top-0 mt-0 rounded-b-base border-b data-[closing]:slide-out-to-top data-[open]:slide-in-from-top',
48+
top: 'inset-x-0 top-0 mb-auto mt-0 rounded-b-base border-b data-[closing]:slide-out-to-top data-[open]:slide-in-from-top',
4949
bottom:
50-
'inset-x-0 bottom-0 mb-0 rounded-t-base border-t data-[closing]:slide-out-to-bottom data-[open]:slide-in-from-bottom',
51-
left: 'inset-y-0 left-0 ml-0 h-full max-w-sm rounded-r-base border-r data-[closing]:slide-out-to-left data-[open]:slide-in-from-left',
50+
'inset-x-0 bottom-0 mb-0 mt-auto rounded-t-base border-t data-[closing]:slide-out-to-bottom data-[open]:slide-in-from-bottom',
51+
left: 'inset-y-0 left-0 ml-0 mr-auto h-full max-w-sm rounded-r-base border-r data-[closing]:slide-out-to-left data-[open]:slide-in-from-left',
5252
right:
53-
'inset-y-0 right-0 mr-0 h-full max-w-sm rounded-l-base border-l data-[closing]:slide-out-to-right data-[open]:slide-in-from-right',
53+
'inset-y-0 right-0 ml-auto mr-0 h-full max-w-sm rounded-l-base border-l data-[closing]:slide-out-to-right data-[open]:slide-in-from-right',
5454
},
5555
},
5656
defaultVariants: {

packages/kit-styled/src/components/modal/modal.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,12 @@ export const panelVariants = cva(
2020
position: {
2121
center:
2222
'max-w-lg rounded-base shadow-lg data-[closed]:fade-out data-[open]:fade-in data-[closed]:zoom-out-95 data-[open]:zoom-in-95 data-[open]:slide-in-from-bottom-2 backdrop:data-[closing]:fade-out backdrop:data-[open]:fade-in',
23-
top: 'inset-x-0 top-0 mt-0 rounded-b-base border-b data-[closing]:slide-out-to-top data-[open]:slide-in-from-top',
23+
top: 'inset-x-0 top-0 mb-auto mt-0 rounded-b-base border-b data-[closing]:slide-out-to-top data-[open]:slide-in-from-top',
2424
bottom:
25-
'inset-x-0 bottom-0 mb-0 rounded-t-base border-t data-[closing]:slide-out-to-bottom data-[open]:slide-in-from-bottom',
26-
left: 'inset-y-0 left-0 ml-0 h-full max-w-sm rounded-r-base border-r data-[closing]:slide-out-to-left data-[open]:slide-in-from-left',
25+
'inset-x-0 bottom-0 mb-0 mt-auto rounded-t-base border-t data-[closing]:slide-out-to-bottom data-[open]:slide-in-from-bottom',
26+
left: 'inset-y-0 left-0 ml-0 mr-auto h-full max-w-sm rounded-r-base border-r data-[closing]:slide-out-to-left data-[open]:slide-in-from-left',
2727
right:
28-
'inset-y-0 right-0 mr-0 h-full max-w-sm rounded-l-base border-l data-[closing]:slide-out-to-right data-[open]:slide-in-from-right',
28+
'inset-y-0 right-0 ml-auto mr-0 h-full max-w-sm rounded-l-base border-l data-[closing]:slide-out-to-right data-[open]:slide-in-from-right',
2929
},
3030
},
3131
defaultVariants: {

0 commit comments

Comments
 (0)