File tree Expand file tree Collapse file tree 3 files changed +22
-8
lines changed
uikit-workshop/src/scripts/lit-components Expand file tree Collapse file tree 3 files changed +22
-8
lines changed 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
15
15
16
16
Modifying the viewport:
17
17
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
24
24
25
25
Modifying the views:
26
26
Original file line number Diff line number Diff line change @@ -18,7 +18,12 @@ pl-viewport-size {
18
18
.pl-c-viewport-size {
19
19
margin : 0 ;
20
20
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
+
22
27
padding : 0.3rem 0.25rem ;
23
28
line-height : 1 ;
24
29
display : flex ;
@@ -45,7 +50,7 @@ pl-viewport-size {
45
50
}
46
51
47
52
.pl-c-viewport-size__input-action {
48
- max-width : 40 px ;
53
+ max-width : 47 px ;
49
54
font-size : inherit ;
50
55
pointer-events : auto ;
51
56
Original file line number Diff line number Diff line change @@ -55,6 +55,7 @@ class IFrame extends BaseLitComponent {
55
55
this . themeMode = state . app . themeMode || 'dark' ;
56
56
this . isViewallPage = state . app . isViewallPage || false ;
57
57
this . currentPattern = state . app . currentPattern || '' ;
58
+ this . layoutMode = state . app . layoutMode ;
58
59
59
60
if ( state . app . viewportPx ) {
60
61
this . sizeiframe ( state . app . viewportPx , false ) ;
@@ -312,6 +313,14 @@ class IFrame extends BaseLitComponent {
312
313
this . sizeiframe ( this . iframe . clientWidth , false ) ;
313
314
}
314
315
}
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
+ }
315
324
}
316
325
317
326
navigateTo ( pattern = patternName ) {
You can’t perform that action at this time.
0 commit comments