-
Notifications
You must be signed in to change notification settings - Fork 4.2k
/
style.scss
170 lines (149 loc) · 3.93 KB
/
style.scss
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
// The scrim behind the modal window.
.components-modal__screen-overlay {
position: fixed;
top: 0;
right: 0;
bottom: 0;
left: 0;
background-color: rgba($black, 0.35);
z-index: z-index(".components-modal__screen-overlay");
display: flex;
// backdrop-filter: blur($grid-unit);
// This animates the appearance of the white background.
@include edit-post__fade-in-animation();
}
// The modal window element.
.components-modal__frame {
@include reset;
// Use the entire viewport on smaller screens.
margin: $grid-unit-50 0 0 0;
width: 100%;
background: $white;
box-shadow: $shadow-modal;
border-radius: $grid-unit-05 $grid-unit-05 0 0;
overflow: hidden;
// Have the content element fill the vertical space yet not overflow.
display: flex;
// Animate the modal frame/contents appearing on the page.
animation: components-modal__appear-animation 0.1s ease-out;
animation-fill-mode: forwards;
@include reduce-motion("animation");
// Show a centered modal on bigger screens.
@include break-small() {
border-radius: $grid-unit-05;
margin: auto;
width: auto;
min-width: $modal-min-width;
max-width: calc(100% - #{$grid-unit-20 * 2});
max-height: calc(100% - #{$header-height * 2});
&.is-full-screen {
@include break-small() {
width: calc(100% - #{ $grid-unit-20 * 2 });
height: calc(100% - #{ $grid-unit-20 * 2 });
max-height: none;
}
@include break-medium() {
width: calc(100% - #{ $grid-unit-50 * 2 });
height: calc(100% - #{ $grid-unit-50 * 2 });
max-width: none;
}
}
&.has-size-small,
&.has-size-medium,
&.has-size-large {
width: 100%;
}
// The following widths were selected to align with existing baselines
// found elsewhere in the editor.
// See https://github.com/WordPress/gutenberg/pull/54471#issuecomment-1723818809
&.has-size-small {
max-width: $modal-width-small;
}
&.has-size-medium {
max-width: $modal-width-medium;
}
&.has-size-large {
max-width: $modal-width-large;
}
}
@include break-large() {
max-height: 70%;
}
}
@keyframes components-modal__appear-animation {
from {
transform: translateY($grid-unit-40);
}
to {
transform: translateY(0);
}
}
// Fix header to the top so it is always there to provide context to the modal
// if the content needs to be scrolled (for example, on the keyboard shortcuts
// modal screen).
.components-modal__header {
box-sizing: border-box;
border-bottom: $border-width solid transparent;
padding: $grid-unit-30 $grid-unit-40 $grid-unit-10;
display: flex;
flex-direction: row;
justify-content: space-between;
align-items: center;
height: $header-height + $grid-unit-15;
width: 100%;
z-index: z-index(".components-modal__header");
position: absolute;
top: 0;
left: 0;
.components-modal__header-heading {
font-size: 1.2rem;
font-weight: 600;
}
h1 {
line-height: 1;
margin: 0;
}
.components-button {
position: relative;
left: $grid-unit-10;
}
.components-modal__content.has-scrolled-content:not(.hide-header) & {
border-bottom-color: $gray-300;
}
& + p {
margin-top: 0;
}
}
.components-modal__header-heading-container {
align-items: center;
flex-grow: 1;
display: flex;
flex-direction: row;
justify-content: left;
}
.components-modal__header-icon-container {
display: inline-block;
svg {
max-width: $button-size;
max-height: $button-size;
padding: $grid-unit-10;
}
}
// Modal contents.
.components-modal__content {
flex: 1;
margin-top: $header-height + $grid-unit-15;
// Small top padding required to avoid cutting off the visible outline when the first child element is focusable.
padding: $grid-unit-05 $grid-unit-40 $grid-unit-40;
overflow: auto;
&.hide-header {
margin-top: 0;
padding-top: $grid-unit-40;
}
&.is-scrollable:focus-visible {
box-shadow: inset 0 0 0 var(--wp-admin-border-width-focus) $components-color-accent;
// Windows High Contrast mode will show this outline, but not the box-shadow.
outline: 2px solid transparent;
outline-offset: -2px;
}
}