Skip to content

Commit

Permalink
Merge pull request pattern-lab#1132 from pattern-lab/feature/hide-res…
Browse files Browse the repository at this point in the history
…izer-when-full-screen

Update Pattern Lab's iframe resizer UI to be hidden when iframe is full width
  • Loading branch information
bmuenzenmeyer committed Mar 23, 2020
2 parents 76495da + ce383ad commit 5e142b1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,15 +48,15 @@ class ViewportSize extends BaseLitComponent {

updated() {
if (this.viewport && this.viewport.bodySize) {
this.em = Math.floor(this.px - 40 * this.bodySize);
this.em = Math.floor(this.px * this.bodySize);
}
}

render() {
if (!window.__PRERENDER_INJECTED) {
return html`
<form class="pl-c-viewport-size" method="post" action="#">
<span class="pl-c-viewport-size__input">${this.px - 40}px</span
<span class="pl-c-viewport-size__input">${this.px}px</span
>&nbsp;/&nbsp;
<span class="pl-c-viewport-size__input">${this.em}em</span>
</form>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,8 @@ pl-iframe {
min-width: 240px;
max-width: 100vw;
background: $pl-viewport-bg;
padding-right: $pl-resizer-width;
padding-left: $pl-resizer-width;
padding-right: 0;
padding-left: 0;
// box-shadow: 0 3px 6px rgba(21,22,25,.16), 0 3px 6px rgba(21,22,25,.23);

&.hay-mode {
Expand Down Expand Up @@ -153,7 +153,7 @@ pl-iframe {
.pl-c-viewport__resizer {
position: absolute;
width: $pl-resizer-width;
right: 0;
right: $pl-resizer-width * -1;
top: 0;
bottom: 0;
margin: 0;
Expand Down

0 comments on commit 5e142b1

Please sign in to comment.