Skip to content

Commit 7d1ea8e

Browse files
committed
Adding the modals component
1 parent 05060c4 commit 7d1ea8e

2 files changed

Lines changed: 422 additions & 1 deletion

File tree

dist/css/tani.css

Lines changed: 167 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
Name: Tani
33
Description: A utility-first framework with rich component library
44
Author: Raymond Baghumian
5-
Version: 1.0.0
5+
Version: 1.1.0
66
License: MIT
77
*/
88

@@ -2323,6 +2323,172 @@ p {
23232323
display: none !important;
23242324
}
23252325

2326+
/* ======================
2327+
Modals
2328+
====================== */
2329+
.modal {
2330+
display: none;
2331+
position: fixed;
2332+
z-index: 1050;
2333+
left: 0;
2334+
top: 0;
2335+
width: 100%;
2336+
height: 100%;
2337+
overflow: auto;
2338+
background-color: rgba(0, 0, 0, 0);
2339+
transition: background-color 0.3s ease;
2340+
}
2341+
2342+
.modal.show {
2343+
display: block;
2344+
animation: modalFadeIn 0.3s ease;
2345+
}
2346+
2347+
.modal.show {
2348+
background-color: rgba(0, 0, 0, 0.5);
2349+
}
2350+
2351+
.modal.fade-out {
2352+
animation: modalFadeOut 0.3s ease;
2353+
}
2354+
2355+
@keyframes modalFadeIn {
2356+
from {
2357+
background-color: rgba(0, 0, 0, 0);
2358+
}
2359+
2360+
to {
2361+
background-color: rgba(0, 0, 0, 0.5);
2362+
}
2363+
}
2364+
2365+
@keyframes modalFadeOut {
2366+
from {
2367+
background-color: rgba(0, 0, 0, 0.5);
2368+
}
2369+
2370+
to {
2371+
background-color: rgba(0, 0, 0, 0);
2372+
}
2373+
}
2374+
2375+
.modal-dialog {
2376+
position: relative;
2377+
width: auto;
2378+
max-width: 500px;
2379+
margin: 1.75rem auto;
2380+
pointer-events: none;
2381+
transform: translateY(-50px);
2382+
opacity: 0;
2383+
transition: transform 0.3s ease, opacity 0.3s ease;
2384+
}
2385+
2386+
.modal.show .modal-dialog {
2387+
transform: translateY(0);
2388+
opacity: 1;
2389+
}
2390+
2391+
.modal.fade-out .modal-dialog {
2392+
transform: translateY(-50px);
2393+
opacity: 0;
2394+
}
2395+
2396+
.modal-dialog-centered {
2397+
display: flex;
2398+
align-items: center;
2399+
min-height: calc(100% - 3.5rem);
2400+
}
2401+
2402+
.modal-content {
2403+
position: relative;
2404+
display: flex;
2405+
flex-direction: column;
2406+
width: 100%;
2407+
pointer-events: auto;
2408+
background-color: #fff;
2409+
background-clip: padding-box;
2410+
border: 1px solid rgba(0, 0, 0, 0.2);
2411+
border-radius: 0.3rem;
2412+
outline: 0;
2413+
box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
2414+
}
2415+
2416+
.modal-header {
2417+
display: flex;
2418+
align-items: center;
2419+
justify-content: space-between;
2420+
padding: 1rem;
2421+
border-bottom: 1px solid #dee2e6;
2422+
border-top-left-radius: 0.3rem;
2423+
border-top-right-radius: 0.3rem;
2424+
}
2425+
2426+
.modal-title {
2427+
margin: 0;
2428+
line-height: 1.5;
2429+
font-size: 1.25rem;
2430+
font-weight: 500;
2431+
}
2432+
2433+
.modal-body {
2434+
position: relative;
2435+
flex: 1 1 auto;
2436+
padding: 1rem;
2437+
}
2438+
2439+
.modal-footer {
2440+
display: flex;
2441+
flex-wrap: wrap;
2442+
align-items: center;
2443+
justify-content: flex-end;
2444+
padding: 0.75rem;
2445+
border-top: 1px solid #dee2e6;
2446+
border-bottom-right-radius: 0.3rem;
2447+
border-bottom-left-radius: 0.3rem;
2448+
}
2449+
2450+
.modal-footer>* {
2451+
margin: 0.25rem;
2452+
}
2453+
2454+
.modal-close {
2455+
background: transparent;
2456+
border: 0;
2457+
font-size: 1.5rem;
2458+
font-weight: 700;
2459+
line-height: 1;
2460+
color: #000;
2461+
opacity: 0.5;
2462+
cursor: pointer;
2463+
padding: 0;
2464+
width: 1.5rem;
2465+
height: 1.5rem;
2466+
}
2467+
2468+
.modal-close:hover {
2469+
opacity: 0.75;
2470+
}
2471+
2472+
/* Modal sizes */
2473+
.modal-sm {
2474+
max-width: 300px;
2475+
}
2476+
2477+
.modal-lg {
2478+
max-width: 800px;
2479+
}
2480+
2481+
.modal-xl {
2482+
max-width: 1140px;
2483+
}
2484+
2485+
/* Responsive modal */
2486+
@media (max-width: 576px) {
2487+
.modal-dialog {
2488+
margin: 0.5rem;
2489+
max-width: calc(100% - 1rem);
2490+
}
2491+
}
23262492
/* ======================
23272493
Accessibility helpers
23282494
====================== */

0 commit comments

Comments
 (0)