Skip to content

Commit

Permalink
feat(core): ✨ add overlay as affordnance to popup menus
Browse files Browse the repository at this point in the history
  • Loading branch information
alistair3149 committed Jul 14, 2023
1 parent 0d7fff1 commit 703fac6
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 31 deletions.
1 change: 1 addition & 0 deletions resources/mixins.less
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
// When using fadeChildren, the child elements need to have
// opacity: 0 set manually
.citizen-card-show( @fadeChildren: true ) {
z-index: @z-index-overlay;
opacity: 1;
pointer-events: auto;
transform: none;
Expand Down
28 changes: 27 additions & 1 deletion resources/skins.citizen.styles/components/Header.less
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,6 @@
}

&__inner {
z-index: -1; // Inner element should be behind menu and search
display: flex;
min-width: 0;
flex-direction: var( --header-direction );
Expand Down Expand Up @@ -177,6 +176,33 @@
.citizen-header {
transition: var( --transition-menu );
transition-property: transform;

/*
* Add overlay to menus as affordnance
* TODO: We should use JS to add the overlay instead of abusing CSS
*/
.citizen-menu-checkbox-checkbox,
.citizen-button {
contain: initial;

&[ aria-expanded='true' ] {
&::before {
position: fixed;
top: 0;
right: 0;
bottom: 0;
left: 0;
width: auto;
height: auto;
background-color: var( --background-color-overlay );
content: '';
}

~ .citizen-menu-checkbox-target {
z-index: 1;
}
}
}
}

.citizen-scroll--down .citizen-header {
Expand Down
1 change: 0 additions & 1 deletion resources/skins.citizen.styles/components/Menu.less
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@
height: 0;
padding: 0;
margin: 0;
opacity: 0;

// HACK: Fake focus styles
&:focus {
Expand Down
28 changes: 0 additions & 28 deletions resources/skins.citizen.styles/components/Search.less
Original file line number Diff line number Diff line change
Expand Up @@ -127,32 +127,4 @@
transition: none;
}
}

#citizen-search__checkbox:checked {
+ .citizen-search__card {
z-index: 2;
}

// HACK: Click overlay to dismiss search bar
~ .citizen-search__button {
// Reset containment so that the overlay is visible
contain: initial;

.citizen-search__buttonIcon {
display: none;
}

#citizen-search__buttonCheckbox {
position: fixed;
z-index: 1;
top: 0;
right: 0;
bottom: 0;
left: 0;
width: auto;
height: auto;
background-color: var( --background-color-overlay );
}
}
}
}
1 change: 0 additions & 1 deletion skinStyles/extensions/Echo/ext.echo.styles.badge.less
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@
// Add quiet background hover states
#pt-notifications-alert,
#pt-notifications-notice {
z-index: 1; // fix background clipping
border-radius: var( --border-radius--small );

&:hover {
Expand Down

0 comments on commit 703fac6

Please sign in to comment.