Skip to content

Commit

Permalink
add modal component
Browse files Browse the repository at this point in the history
  • Loading branch information
saadeghi committed Feb 25, 2021
1 parent 934c6cd commit 98e6fe0
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/base/components/modal.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
.modal{
@apply inset-0 invisible opacity-0 pointer-events-none fixed grid place-items-end sm:place-items-center;
z-index: 999;
}
.modal:target {
@apply visible opacity-100 pointer-events-auto;
}
.modal-action{
@apply flex;
}
1 change: 1 addition & 0 deletions src/base/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,4 @@
@import "./components/textarea";
@import "./components/drawer";
@import "./components/tab";
@import "./components/modal";
13 changes: 13 additions & 0 deletions src/styled/components/modal.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
.modal{
@apply transition duration-200 ease-in-out;
background-color: hsl(0deg 0% 0% / 40%);
}
.modal-box{
@apply transform translate-y-10 sm:translate-y-0 sm:scale-90 transition duration-200 ease-in-out rounded-t-box sm:rounded-b-box bg-default sm:max-w-lg p-6 shadow-2xl w-full;
}
.modal:target .modal-box{
@apply translate-y-0 scale-100;
}
.modal-action{
@apply mt-6 justify-end space-x-2;
}
1 change: 1 addition & 0 deletions src/styled/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,4 @@
@import "./components/tab";
@import "../utility/glass";

@import "./components/modal";

0 comments on commit 98e6fe0

Please sign in to comment.