File tree Expand file tree Collapse file tree
uikit-workshop/src/scripts/lit-components Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -15,12 +15,12 @@ Pattern Lab comes with support for a number of special keyboard shortcuts to mak
1515
1616Modifying the viewport:
1717
18- - ** ctrl+shift +0** : set the viewport to 320px
19- - ** ctrl+shift +s** : set the viewport to "small"
20- - ** ctrl+shift +m** : set the viewport to "medium"
21- - ** ctrl+shift +l** : set the viewport to "large"
22- - ** ctrl+shift +h** : toggle Hay mode
23- - ** ctrl+shift +d** : toggle disco mode
18+ - ** ctrl+alt +0** : set the viewport to 320px
19+ - ** ctrl+alt +s** : set the viewport to "small"
20+ - ** ctrl+alt +m** : set the viewport to "medium"
21+ - ** ctrl+alt +l** : set the viewport to "large"
22+ - ** ctrl+alt +h** : toggle Hay mode
23+ - ** ctrl+alt +d** : toggle disco mode
2424
2525Modifying the views:
2626
Original file line number Diff line number Diff line change @@ -18,7 +18,12 @@ pl-viewport-size {
1818.pl-c-viewport-size {
1919 margin : 0 ;
2020 border : 0 ;
21- font-size : 0.85rem ;
21+
22+ // Prevent zooming on phone browser when the font size is smaller than 16px
23+ // As it would break the visualization the field itself will be scaled to 85%
24+ font-size : 1rem ;
25+ transform : scale (0.85 );
26+
2227 padding : 0.3rem 0.25rem ;
2328 line-height : 1 ;
2429 display : flex ;
@@ -45,7 +50,7 @@ pl-viewport-size {
4550}
4651
4752.pl-c-viewport-size__input-action {
48- max-width : 40 px ;
53+ max-width : 47 px ;
4954 font-size : inherit ;
5055 pointer-events : auto ;
5156
Original file line number Diff line number Diff line change @@ -55,6 +55,7 @@ class IFrame extends BaseLitComponent {
5555 this . themeMode = state . app . themeMode || 'dark' ;
5656 this . isViewallPage = state . app . isViewallPage || false ;
5757 this . currentPattern = state . app . currentPattern || '' ;
58+ this . layoutMode = state . app . layoutMode ;
5859
5960 if ( state . app . viewportPx ) {
6061 this . sizeiframe ( state . app . viewportPx , false ) ;
@@ -312,6 +313,14 @@ class IFrame extends BaseLitComponent {
312313 this . sizeiframe ( this . iframe . clientWidth , false ) ;
313314 }
314315 }
316+
317+ // Update size when layout is changed
318+ if ( this . layoutMode !== state . app . layoutMode ) {
319+ this . layoutMode = state . app . layoutMode ;
320+ if ( this . iframeContainer ) {
321+ this . updateSizeReading ( this . iframeContainer . clientWidth ) ;
322+ }
323+ }
315324 }
316325
317326 navigateTo ( pattern = patternName ) {
You can’t perform that action at this time.
0 commit comments