Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions packages/edit-post/src/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,16 @@ body.js.block-editor-page {

&.is-fullscreen-mode {
@include break-medium {
// Relayed through a custom property to keep `body` the subject of
// its own `:has()`. With `body:has(…) #wpadminbar`, every DOM change
// in the editor recalculates the whole document.
&:has(.editor-editor-interface.is-distraction-free) {
--wp-admin--admin-bar--height: 0px;
--wp-editor-admin-bar-display: none;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know some of this is pre-existent, But I'd prefer that we avoid CSS variables as much as possible as they become kind of APIs. Might not be always possible though.

}

#wpadminbar {
display: none;
}
#wpadminbar {
display: var(--wp-editor-admin-bar-display, block);
}
}
}
Expand Down
10 changes: 7 additions & 3 deletions packages/edit-site/src/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,16 @@ body.js.site-editor-php {
background: var(--wpds-color-background-surface-neutral-weak);

@include break-medium {
// Relayed through a custom property to keep `body` the subject of its
// own `:has()`. With `body:has(…) #wpadminbar`, every DOM change in the
// editor recalculates the whole document.
&:has(.editor-editor-interface.is-distraction-free) {
--wp-admin--admin-bar--height: 0px;
--wp-editor-admin-bar-display: none;
}

#wpadminbar {
display: none;
}
#wpadminbar {
display: var(--wp-editor-admin-bar-display, block);
}
}
}
Expand Down
6 changes: 3 additions & 3 deletions packages/editor/src/components/collab-sidebar/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@

.interface-interface-skeleton__sidebar:has(.editor-collab-sidebar) {
box-shadow: none;
}

.interface-complementary-area-header {
display: none;
}
.editor-collab-sidebar__header {
display: none;
}

.editor-collab-sidebar {
Expand Down
47 changes: 25 additions & 22 deletions packages/editor/src/components/post-revisions-timeline/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,41 +3,44 @@
//
// The timeline only renders in revisions mode, so its ancestors are scoped
// with `:has()` — keeping this layout out of the generic editor sidebar.
//
// Keep each `:has()` the subject of its rule: a subject below it recalculates
// the anchor's whole subtree on every DOM change in the editor.
.interface-complementary-area:has(.editor-post-revisions-timeline) {
display: flex;
flex-direction: column;
overflow: hidden;
}

// The tabs header keeps its natural height.
.editor-sidebar__panel-tabs {
flex-shrink: 0;
}
// The tabs header keeps its natural height. Inert unless the rule above applies.
.interface-complementary-area > .editor-sidebar__panel-tabs {
flex-shrink: 0;
}

.editor-sidebar__panel:has(.editor-post-revisions-timeline) {
display: flex;
flex-direction: column;
flex: 1;
min-height: 0;
}

// The document tab panel hands its bounded height down to the timeline.
[role="tabpanel"]:has(.editor-post-revisions-timeline) {
display: flex;
flex-direction: column;
flex: 1;
min-height: 0;
}
// The document tab panel hands its bounded height down to the timeline.
.editor-sidebar__panel [role="tabpanel"]:has(.editor-post-revisions-timeline) {
display: flex;
flex-direction: column;
flex: 1;
min-height: 0;
}

// Cap only the post-meta diff content so a large
// diff (e.g. footnotes) can't dominate the column.
.editor-revision-meta-diff__content {
max-height: 80px;
overflow-y: auto;
}
// Cap only the post-meta diff content so a large
// diff (e.g. footnotes) can't dominate the column.
.editor-sidebar__panel .editor-revision-meta-diff__content {
max-height: 80px;
overflow-y: auto;
}

// timeline grows to fill the leftover space and scrolls internally.
.editor-post-revisions-timeline {
flex: 1;
min-height: 0;
}
// timeline grows to fill the leftover space and scrolls internally.
.editor-sidebar__panel .editor-post-revisions-timeline {
flex: 1;
min-height: 0;
}
Loading