Skip to content

Instantly share code, notes, and snippets.

@iansvo
Last active July 3, 2023 11:12
Show Gist options
  • Save iansvo/3379fc212abd622561097f4b244337aa to your computer and use it in GitHub Desktop.
Save iansvo/3379fc212abd622561097f4b244337aa to your computer and use it in GitHub Desktop.
CSS Snippet to calculate the real available width of the WordPress block editor
.edit-post-layout:has(.interface-interface-skeleton__secondary-sidebar) {
--overview-width: 350px;
}
.edit-post-layout.is-sidebar-opened {
--settings-width: 280px;
}
.edit-post-layout {
--scrollbar-width: 16px;
--canvas-width: calc(100vw - var(--overview-width, 0px) - var(--settings-width, 0px) - var(--scrollbar-width));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment