Include FromBorderSize & Scrollbars in Frame width. To fit responsive sizes properly.
This commit is contained in:
Vendored
+1262
-3110
File diff suppressed because it is too large
Load Diff
+1
-1
File diff suppressed because one or more lines are too long
@@ -63,8 +63,13 @@ function Responsive(props = {}) {
|
||||
}
|
||||
|
||||
function updateController() {
|
||||
const unit = typeof breakpoint === 'string' ? '' : 'px';
|
||||
previewFrame.style.setProperty('--breakpoint', breakpoint + unit);
|
||||
let frameBreakpoint = breakpoint;
|
||||
if (typeof frameBreakpoint !== 'string') {
|
||||
const browserGap = 17; // Scrollbars + Borders
|
||||
frameBreakpoint = (frameBreakpoint + browserGap) + 'px';
|
||||
}
|
||||
|
||||
previewFrame.style.setProperty('--breakpoint', frameBreakpoint);
|
||||
previewFrame.classList.add('has-breakpoint');
|
||||
window.postMessage('responsiveUpdate');
|
||||
window.responsiveState = {mode, breakpoint};
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
body {
|
||||
margin: 0;
|
||||
overflow-y: scroll;
|
||||
}
|
||||
|
||||
main {
|
||||
|
||||
@@ -1 +1 @@
|
||||
{"version":3,"sourceRoot":"","sources":["page--view.scss"],"names":[],"mappings":"AAAA;EACE;;;AAGF;EACE;EACA;EACA;;;AAGF;EACE;EACA;EACA;EACA;EACA","file":"page--view.css"}
|
||||
{"version":3,"sourceRoot":"","sources":["page--view.scss"],"names":[],"mappings":"AAAA;EACE;EACA;;;AAGF;EACE;EACA;;;AAGF;EACE;EACA;EACA;EACA;EACA","file":"page--view.css"}
|
||||
@@ -1,5 +1,6 @@
|
||||
body {
|
||||
margin: 0;
|
||||
overflow-y: scroll;
|
||||
}
|
||||
|
||||
main {
|
||||
|
||||
Reference in New Issue
Block a user