UNPKG

2.41 kBJavaScriptView Raw
1import {
2 component_styles_default
3} from "./chunk.7IGWJVQF.js";
4import {
5 r
6} from "./chunk.WWAD5WF4.js";
7
8// src/components/dialog/dialog.styles.ts
9var dialog_styles_default = r`
10 ${component_styles_default}
11
12 :host {
13 --width: 31rem;
14 --header-spacing: var(--sl-spacing-large);
15 --body-spacing: var(--sl-spacing-large);
16 --footer-spacing: var(--sl-spacing-large);
17
18 display: contents;
19 }
20
21 .dialog {
22 display: flex;
23 align-items: center;
24 justify-content: center;
25 position: fixed;
26 top: 0;
27 right: 0;
28 bottom: 0;
29 left: 0;
30 z-index: var(--sl-z-index-dialog);
31 }
32
33 .dialog__panel {
34 display: flex;
35 flex-direction: column;
36 z-index: 2;
37 width: var(--width);
38 max-width: calc(100% - var(--sl-spacing-2x-large));
39 max-height: calc(100% - var(--sl-spacing-2x-large));
40 background-color: var(--sl-panel-background-color);
41 border-radius: var(--sl-border-radius-medium);
42 box-shadow: var(--sl-shadow-x-large);
43 }
44
45 .dialog__panel:focus {
46 outline: none;
47 }
48
49 /* Ensure there's enough vertical padding for phones that don't update vh when chrome appears (e.g. iPhone) */
50 @media screen and (max-width: 420px) {
51 .dialog__panel {
52 max-height: 80vh;
53 }
54 }
55
56 .dialog--open .dialog__panel {
57 display: flex;
58 opacity: 1;
59 transform: none;
60 }
61
62 .dialog__header {
63 flex: 0 0 auto;
64 display: flex;
65 }
66
67 .dialog__title {
68 flex: 1 1 auto;
69 font: inherit;
70 font-size: var(--sl-font-size-large);
71 line-height: var(--sl-line-height-dense);
72 padding: var(--header-spacing);
73 margin: 0;
74 }
75
76 .dialog__close {
77 flex: 0 0 auto;
78 display: flex;
79 align-items: center;
80 font-size: var(--sl-font-size-x-large);
81 padding: 0 var(--header-spacing);
82 }
83
84 .dialog__body {
85 flex: 1 1 auto;
86 padding: var(--body-spacing);
87 overflow: auto;
88 -webkit-overflow-scrolling: touch;
89 }
90
91 .dialog__footer {
92 flex: 0 0 auto;
93 text-align: right;
94 padding: var(--footer-spacing);
95 }
96
97 .dialog__footer ::slotted(sl-button:not(:first-of-type)) {
98 margin-inline-start: var(--sl-spacing-x-small);
99 }
100
101 .dialog:not(.dialog--has-footer) .dialog__footer {
102 display: none;
103 }
104
105 .dialog__overlay {
106 position: fixed;
107 top: 0;
108 right: 0;
109 bottom: 0;
110 left: 0;
111 background-color: var(--sl-overlay-background-color);
112 }
113`;
114
115export {
116 dialog_styles_default
117};