Skip to content

Commit cd60b6d

Browse files
committed
refactor: update viewport and modal layouts to work with horizontal and vertical layout orientations; add some minor UI polish to help separate out the bottom drawer UI from the sidebar when the sidebar itself is visible; clean up modal drawer handle and close buttons
1 parent cd37c29 commit cd60b6d

File tree

2 files changed

+48
-64
lines changed

2 files changed

+48
-64
lines changed

packages/uikit-workshop/src/sass/scss/04-components/_modal.scss

Lines changed: 48 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,17 @@
22
#MODAL
33
\*------------------------------------*/
44

5+
pl-modal {
6+
display: flex;
7+
flex-direction: column;
8+
position: relative;
9+
z-index: 20;
10+
max-height: 100vh;
11+
box-shadow: 0 0 2px 0 $pl-color-gray-70;
12+
overflow: visible;
13+
}
14+
15+
516
/**
617
* 1) The modal slides up from the bottom of the viewport when
718
* "show pattern info" is selected on the pattern detail screen.
@@ -10,7 +21,7 @@
1021
display: flex;
1122
flex-direction: column;
1223
font-family: $pl-font;
13-
background-color: $pl-color-black;
24+
background-color: $pl-color-gray-87;
1425
color: $pl-color-gray-20;
1526
position: relative;
1627
top: auto;
@@ -43,6 +54,14 @@
4354
}
4455
}
4556

57+
.pl-c-modal__wrapper {
58+
transform: translate3d(0, 0, 0);
59+
}
60+
61+
.pl-c-modal__wrapper > * {
62+
height: 100%;
63+
}
64+
4665
.pl-c-modal__toolbar {
4766
display: flex;
4867
}
@@ -59,40 +78,31 @@
5978
* 1) Closes the modal popup
6079
*/
6180
.pl-c-modal__close-btn {
62-
font-size: 70%;
63-
background-color: $pl-color-black;
64-
color: $pl-color-gray-50;
65-
border: 0;
66-
border-radius: $pl-border-radius-med $pl-border-radius-med 0 0;
67-
display: inline-block;
68-
padding: 0.5rem 0.5rem 0.3rem;
69-
margin: 0;
70-
text-decoration: none;
71-
cursor: pointer;
81+
@include linkStyle;
82+
83+
@media all and (max-width: $pl-bp-med - 1) {
84+
border-radius: 20rem;
85+
padding-top: 0.5rem;
86+
padding-bottom: 0.5rem;
87+
}
88+
7289
z-index: 2;
73-
transition: all $pl-animate-quick ease-out;
90+
opacity: 0.85;
91+
display: flex;
92+
justify-content: center;
7493

7594
&:hover,
7695
&:focus {
77-
background-color: $pl-color-gray-87;
78-
color: $pl-color-white;
96+
opacity: 1;
7997
}
8098

8199
&:focus,
82100
&:active {
83-
outline: 1px dotted $pl-color-gray-50;
84-
outline-offset: -2px;
85-
}
86-
87-
/**
88-
* Modal close button inside active modal
89-
* 1) Move modal button outside of the modal window
90-
*/
91-
.pl-c-modal.pl-is-active & {
92-
bottom: 100%; /* 1 */
101+
opacity: 1;
93102
}
94103
}
95104

105+
96106
.pl-c-modal__cover {
97107
width: 100%;
98108
height: 100%;
@@ -109,22 +119,29 @@
109119
left: 0;
110120
height: 14px;
111121
width: 100%;
112-
background-color: $pl-color-black;
122+
background-color: inherit;
113123
z-index: 2;
114124
cursor: ns-resize;
115125

116126
&:after {
117127
content: '';
118128
height: 3px;
119129
width: 50px;
120-
border-top: 1px solid $pl-color-gray-50;
121-
border-bottom: 1px solid $pl-color-gray-50;
122-
transition: border-color $pl-animate-quick ease-out;
130+
border-top: 1px solid currentColor;
131+
border-bottom: 1px solid currentColor;
132+
transition: opacity $pl-animate-normal ease-out;
133+
opacity: 0.5;
134+
background-color: currentColor;
135+
border-radius: 3px;
136+
}
137+
138+
&:hover:after {
139+
opacity: 0.8;
123140
}
124141

125-
&:hover:after,
126-
&:focus:after {
127-
border-color: $pl-color-white;
142+
&:focus:after,
143+
&:active:after {
144+
opacity: 0.95;
128145
}
129146
}
130147

packages/uikit-workshop/src/sass/scss/05-themes/_sidebar-theme.scss

Lines changed: 0 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -204,38 +204,6 @@
204204
* Tools action
205205
*/
206206
.pl-c-tools__action {
207-
padding-left: 0;
208-
padding-right: 0;
209-
}
210-
211-
/**
212-
* Viewport
213-
* 1) Position viewport (that contains all the content)
214-
* so it fits in remaining available space
215-
*/
216-
.pl-c-viewport {
217-
top: 0; /* 1 */
218-
margin-left: auto;
219-
width: calc(
220-
100% - #{$pl-sidebar-width}
221-
); // fixes the viewport being off-center (and too wide) when the sidebar is visible.
222-
}
223-
224-
/**
225-
* Iframe wrapper div
226-
* 1) Wipe out dynamic resizing functionality for sidebar mode
227-
*/
228-
.pl-c-viewport__iframe-wrapper {
229-
width: 100% !important; /* 1 */
230-
}
231-
232-
/**
233-
* Iframe
234-
* 1) Wipe out dynamic resizing functionality for sidebar mode
235-
* TODO: revisit to find ways to resize
236-
*/
237-
.pl-c-viewport__iframe {
238-
width: 100% !important; /* 1 */
239207
}
240208

241209
/**
@@ -245,7 +213,6 @@
245213
* TODO: revisit to find ways to resize
246214
*/
247215
.pl-c-modal {
248-
left: $pl-sidebar-width; /* 1 */
249216
right: 0; /* 1 */
250217
width: auto;
251218
}

0 commit comments

Comments
 (0)