Skip to content

Commit

Permalink
Style simplifications
Browse files Browse the repository at this point in the history
  • Loading branch information
youknowriad committed Dec 15, 2022
1 parent cb92e7d commit ac2274e
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 39 deletions.
3 changes: 3 additions & 0 deletions packages/base-styles/_z-index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,9 @@ $z-layers: (
".skip-to-selected-block": 100000,
".interface-interface-skeleton__actions": 100000,

// The focus styles of the region navigation containers should be above their content.
".is-focusing-regions {region} :focus::after": 1000000

// Show NUX tips above popovers, wp-admin menus, submenus, and sidebar:
".nux-dot-tip": 1000001,

Expand Down
52 changes: 13 additions & 39 deletions packages/components/src/higher-order/navigate-regions/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,17 @@
}

.is-focusing-regions {
[role="region"]:focus {
[role="region"]:focus::after {
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
content: "";
pointer-events: none;
outline: 4px solid $components-color-accent;
outline-offset: -4px;

&::after {
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
content: "";
pointer-events: none;
outline: 4px solid $components-color-accent;
outline-offset: -4px;
z-index: 9999999;
}
z-index: z-index(".is-focusing-regions {region} :focus::after");
}

// Fixes for edge cases.
Expand All @@ -33,31 +28,10 @@
// regardles of the CSS used on other components.

// Header top bar when Distraction free mode is on.
&.is-distraction-free .interface-interface-skeleton__header {
.edit-post-header {
outline: inherit;
outline-offset: inherit;
}
}

// Sidebar toggle button shown when navigating regions.
.interface-interface-skeleton__sidebar {
.edit-post-layout__toggle-sidebar-panel {
outline: inherit;
outline-offset: inherit;
}
}

// Publish sidebar toggle button shown when navigating regions.
.interface-interface-skeleton__actions {
.edit-post-layout__toggle-publish-panel {
outline: inherit;
outline-offset: inherit;
}
}

// Publish sidebar.
[role="region"].interface-interface-skeleton__actions:focus .editor-post-publish-panel {
&.is-distraction-free .interface-interface-skeleton__header .edit-post-header,
.interface-interface-skeleton__sidebar .edit-post-layout__toggle-sidebar-panel,
.interface-interface-skeleton__actions .edit-post-layout__toggle-publish-panel,
.editor-post-publish-panel {
outline: 4px solid $components-color-accent;
outline-offset: -4px;
}
Expand Down

0 comments on commit ac2274e

Please sign in to comment.