Skip to content

Commit c06dcec

Browse files
imnasnainaecalex-rawlings-yyc
authored andcommitted
Fix and consolidate modal styles (#74)
1 parent 242fb7d commit c06dcec

4 files changed

Lines changed: 14 additions & 6 deletions

File tree

src/components/CreateProjectModal.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,10 +102,10 @@ export function CreateProjectModal({
102102
if (stringsLoading) return undefined;
103103

104104
return (
105-
<div className="tw:fixed tw:inset-0 tw:z-50 tw:flex tw:items-center tw:justify-center tw:bg-black/40">
105+
<div className="tw:modal-overlay">
106106
<dialog
107107
aria-labelledby="create-project-modal-title"
108-
className="tw:bg-background tw:text-foreground tw:rounded tw:border tw:border-border tw:p-6 tw:w-96 tw:shadow-lg"
108+
className="tw:modal-dialog tw:rounded tw:w-96"
109109
open
110110
>
111111
<h2

src/components/ProjectMetadataModal.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,11 +148,11 @@ export function ProjectMetadataModal({
148148
if (stringsLoading) return undefined;
149149

150150
return (
151-
<div className="tw:fixed tw:inset-0 tw:z-50 tw:flex tw:items-center tw:justify-center tw:bg-black/40">
151+
<div className="tw:modal-overlay">
152152
<dialog
153153
aria-labelledby="project-metadata-modal-title"
154154
aria-modal="true"
155-
className="tw:bg-background tw:text-foreground tw:rounded-lg tw:border tw:border-border tw:p-6 tw:w-lg tw:shadow-lg"
155+
className="tw:modal-dialog tw:rounded-lg tw:w-lg"
156156
open
157157
>
158158
<h2

src/components/SelectInterlinearProjectModal.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,10 +128,10 @@ export function SelectInterlinearProjectModal({
128128
if (stringsLoading) return undefined;
129129

130130
return (
131-
<div className="tw:fixed tw:inset-0 tw:z-50 tw:flex tw:items-center tw:justify-center tw:bg-black/40">
131+
<div className="tw:modal-overlay">
132132
<dialog
133133
aria-labelledby="select-project-modal-title"
134-
className="tw:bg-background tw:text-foreground tw:rounded-lg tw:border tw:border-border tw:p-6 tw:w-lg tw:shadow-lg"
134+
className="tw:modal-dialog tw:rounded-lg tw:w-lg"
135135
open
136136
>
137137
<h2

src/tailwind.css

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,14 @@
3131
}
3232
}
3333

34+
@utility modal-overlay {
35+
@apply tw:fixed tw:inset-0 tw:z-50 tw:flex tw:items-center tw:justify-center tw:bg-black/40;
36+
}
37+
38+
@utility modal-dialog {
39+
@apply tw:static tw:bg-background tw:text-foreground tw:border tw:border-border tw:p-6 tw:shadow-lg;
40+
}
41+
3442
/*
3543
* CUSTOM: Theme variable policy.
3644
*

0 commit comments

Comments
 (0)