Include FromBorderSize & Scrollbars in Frame width. To fit responsive sizes properly.

This commit is contained in:
2022-10-17 19:39:22 +03:00
parent 7eeafdbd31
commit 7201d360ee
6 changed files with 1273 additions and 3114 deletions
+1262 -3110
View File
File diff suppressed because it is too large Load Diff
File diff suppressed because one or more lines are too long
+7 -2
View File
@@ -63,8 +63,13 @@ function Responsive(props = {}) {
} }
function updateController() { function updateController() {
const unit = typeof breakpoint === 'string' ? '' : 'px'; let frameBreakpoint = breakpoint;
previewFrame.style.setProperty('--breakpoint', breakpoint + unit); if (typeof frameBreakpoint !== 'string') {
const browserGap = 17; // Scrollbars + Borders
frameBreakpoint = (frameBreakpoint + browserGap) + 'px';
}
previewFrame.style.setProperty('--breakpoint', frameBreakpoint);
previewFrame.classList.add('has-breakpoint'); previewFrame.classList.add('has-breakpoint');
window.postMessage('responsiveUpdate'); window.postMessage('responsiveUpdate');
window.responsiveState = {mode, breakpoint}; window.responsiveState = {mode, breakpoint};
+1
View File
@@ -1,5 +1,6 @@
body { body {
margin: 0; margin: 0;
overflow-y: scroll;
} }
main { main {
+1 -1
View File
@@ -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
View File
@@ -1,5 +1,6 @@
body { body {
margin: 0; margin: 0;
overflow-y: scroll;
} }
main { main {