Skip to content

Commit 3002832

Browse files
Merge pull request #1132 from pattern-lab/feature/hide-resizer-when-full-screen
Update Pattern Lab's iframe resizer UI to be hidden when iframe is full width
2 parents f89853e + 8a25ea9 commit 3002832

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

packages/uikit-workshop/src/scripts/lit-components/pl-viewport-size/pl-viewport-size.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,15 +48,15 @@ class ViewportSize extends BaseLitComponent {
4848

4949
updated() {
5050
if (this.viewport && this.viewport.bodySize) {
51-
this.em = Math.floor(this.px - 40 * this.bodySize);
51+
this.em = Math.floor(this.px * this.bodySize);
5252
}
5353
}
5454

5555
render() {
5656
if (!window.__PRERENDER_INJECTED) {
5757
return html`
5858
<form class="pl-c-viewport-size" method="post" action="#">
59-
<span class="pl-c-viewport-size__input">${this.px - 40}px</span
59+
<span class="pl-c-viewport-size__input">${this.px}px</span
6060
>&nbsp;/&nbsp;
6161
<span class="pl-c-viewport-size__input">${this.em}em</span>
6262
</form>

packages/uikit-workshop/src/scripts/lit-components/pl-viewport/pl-viewport.scss

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,8 @@ pl-iframe {
8282
min-width: 240px;
8383
max-width: 100vw;
8484
background: $pl-viewport-bg;
85-
padding-right: $pl-resizer-width;
86-
padding-left: $pl-resizer-width;
85+
padding-right: 0;
86+
padding-left: 0;
8787
// box-shadow: 0 3px 6px rgba(21,22,25,.16), 0 3px 6px rgba(21,22,25,.23);
8888

8989
&.hay-mode {
@@ -153,7 +153,7 @@ pl-iframe {
153153
.pl-c-viewport__resizer {
154154
position: absolute;
155155
width: $pl-resizer-width;
156-
right: 0;
156+
right: $pl-resizer-width * -1;
157157
top: 0;
158158
bottom: 0;
159159
margin: 0;

0 commit comments

Comments
 (0)