Skip to content

Commit af2b0c9

Browse files
committed
chore: move pl-layout Sass import to main Sass file — loading these particular styles via JS isn't needed just yet
1 parent 3ebc106 commit af2b0c9

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

packages/uikit-workshop/src/sass/pattern-lab.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@
4848
* Pattern Lab Header
4949
*/
5050
@import '../scripts/components/pl-search/pl-search.scss';
51+
@import '../scripts/components/pl-layout/pl-layout.scss';
5152
@import 'scss/04-components/header';
5253
@import 'scss/04-components/logo';
5354
@import 'scss/04-components/navigation';

packages/uikit-workshop/src/scripts/components/pl-layout/pl-layout.js

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,15 @@ const classNames = require('classnames');
66
import { store } from '../../store.js'; // connect to redux
77
import { BaseComponent } from '../base-component.js';
88

9-
import './pl-layout.scss?external';
9+
import iFrameResize from 'iframe-resizer/src/iframeResizer.js';
10+
iFrameResize({
11+
checkOrigin: false,
12+
scrolling: false,
13+
heightCalculationMethod: 'documentElementOffset', // most accurate calculation in testing available options
14+
initCallback() {
15+
document.querySelector('.pl-js-iframe').classList.add('is-ready'); // toggles class that removes initial min-height styling
16+
},
17+
});
1018

1119
@define
1220
class Layout extends BaseComponent {
@@ -69,7 +77,8 @@ class Layout extends BaseComponent {
6977
[`pl-c-body--theme-${this.themeMode}`]: this.themeMode !== undefined,
7078
[`pl-c-body--theme-${
7179
this.layoutMode === 'vertical' ? 'sidebar' : 'horizontal'
72-
}`]: this.layoutMode !== undefined,
80+
}`]:
81+
this.layoutMode !== undefined,
7382
});
7483

7584
this.className = classes;

0 commit comments

Comments
 (0)