fix(ui): mobile UI enhancements (#1184)
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
@use "mixins";
|
||||
@use "variables";
|
||||
|
||||
:root {
|
||||
--sidebar-collapsed-width: 61px;
|
||||
@@ -60,7 +61,7 @@
|
||||
display: none;
|
||||
}
|
||||
|
||||
@media (width <= 767px) {
|
||||
@media #{variables.$mobile-shell-media-query} {
|
||||
.layout-sidebar-resize-handle {
|
||||
display: none;
|
||||
}
|
||||
|
||||
@@ -1,34 +1,39 @@
|
||||
@media (width >= 768px) {
|
||||
.layout-wrapper {
|
||||
&.layout-sidebar-hidden {
|
||||
grid-template-columns: 0 minmax(0, 1fr);
|
||||
@use "variables";
|
||||
|
||||
.layout-sidebar {
|
||||
transform: translateX(-100%);
|
||||
pointer-events: none;
|
||||
visibility: hidden;
|
||||
}
|
||||
}
|
||||
.layout-wrapper {
|
||||
&.layout-sidebar-hidden {
|
||||
grid-template-columns: 0 minmax(0, 1fr);
|
||||
|
||||
.layout-mask {
|
||||
display: none;
|
||||
.layout-sidebar {
|
||||
transform: translateX(-100%);
|
||||
pointer-events: none;
|
||||
visibility: hidden;
|
||||
}
|
||||
}
|
||||
|
||||
.layout-mask {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
@media (width <= 767px) {
|
||||
@media #{variables.$mobile-shell-media-query} {
|
||||
.blocked-scroll {
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.layout-wrapper {
|
||||
display: block;
|
||||
background-color: var(--page-background);
|
||||
|
||||
.layout-main {
|
||||
--mobile-topbar-height: 3.5rem;
|
||||
|
||||
box-sizing: border-box;
|
||||
padding-top: var(--mobile-topbar-height);
|
||||
padding:
|
||||
var(--mobile-topbar-height)
|
||||
env(safe-area-inset-right)
|
||||
0
|
||||
env(safe-area-inset-left);
|
||||
}
|
||||
|
||||
.layout-sidebar {
|
||||
@@ -57,9 +62,9 @@
|
||||
top: 0;
|
||||
left: 0;
|
||||
box-sizing: border-box;
|
||||
width: min(24rem, calc(100vw - 1rem));
|
||||
max-width: 100vw;
|
||||
width: 100dvw;
|
||||
height: 100dvh;
|
||||
border-right: 0;
|
||||
padding:
|
||||
calc(var(--space-3) + env(safe-area-inset-top))
|
||||
calc(var(--sidebar-shell-padding-inline-end) + env(safe-area-inset-right))
|
||||
@@ -80,6 +85,7 @@
|
||||
--mobile-sidebar-fade-duration: 220ms;
|
||||
|
||||
position: fixed;
|
||||
display: block;
|
||||
top: 0;
|
||||
left: 0;
|
||||
z-index: 998;
|
||||
@@ -114,11 +120,19 @@
|
||||
}
|
||||
}
|
||||
|
||||
@media (width <= 768px) {
|
||||
.layout-wrapper {
|
||||
.layout-sidebar {
|
||||
width: 100vw;
|
||||
border-right: 0;
|
||||
@media #{variables.$mobile-shell-media-query} {
|
||||
@media (orientation: landscape) {
|
||||
.layout-wrapper {
|
||||
.layout-sidebar {
|
||||
width: fit-content;
|
||||
max-width: calc(100dvw - 1rem);
|
||||
border-right: 1px solid var(--border-color);
|
||||
padding:
|
||||
calc(var(--space-3) + env(safe-area-inset-top))
|
||||
var(--sidebar-shell-padding-inline-end)
|
||||
var(--space-3)
|
||||
calc(var(--sidebar-shell-padding-inline-start) + env(safe-area-inset-left));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,3 +2,4 @@
|
||||
$scale: 14px; /* main font size */
|
||||
$border-radius: 12px; /* border radius of layout element e.g. card, sidebar */
|
||||
$transition-duration: .2s; /* transition duration of layout elements e.g. sidebar */
|
||||
$mobile-shell-media-query: "(width <= 599px), ((width <= 959px) and (height <= 500px) and (pointer: coarse) and (hover: none))";
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
@use "../layout/styles/layout/variables";
|
||||
|
||||
/*
|
||||
* Document defaults.
|
||||
*
|
||||
@@ -8,6 +10,8 @@
|
||||
*/
|
||||
|
||||
html {
|
||||
--mobile-shell-active: 0;
|
||||
|
||||
height: 100%;
|
||||
font-family: var(--font-family), "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", sans-serif;
|
||||
font-size: var(--font-size-root);
|
||||
@@ -24,6 +28,17 @@ body {
|
||||
-moz-osx-font-smoothing: grayscale;
|
||||
}
|
||||
|
||||
@media #{variables.$mobile-shell-media-query} {
|
||||
html {
|
||||
--mobile-shell-active: 1;
|
||||
}
|
||||
|
||||
html,
|
||||
body {
|
||||
background-color: var(--page-background);
|
||||
}
|
||||
}
|
||||
|
||||
a {
|
||||
color: var(--primary-color);
|
||||
text-decoration: none;
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
@use "../layout/styles/layout/variables";
|
||||
|
||||
/*
|
||||
* Native CDK overlay hooks.
|
||||
*
|
||||
@@ -6,15 +8,15 @@
|
||||
*/
|
||||
|
||||
.command-palette-backdrop {
|
||||
background: rgb(0 0 0 / 50%);
|
||||
background: rgb(0 0 0 / 56%);
|
||||
}
|
||||
|
||||
.command-palette-panel {
|
||||
.cdk-overlay-pane.command-palette-panel {
|
||||
display: flex;
|
||||
pointer-events: auto;
|
||||
}
|
||||
|
||||
@media (width <= 991px) {
|
||||
@media #{variables.$mobile-shell-media-query} {
|
||||
.cdk-overlay-backdrop.command-palette-backdrop {
|
||||
top: 3.5rem;
|
||||
}
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
@use "../layout/styles/layout/variables";
|
||||
|
||||
/*
|
||||
* PrimeNG compatibility layer.
|
||||
*
|
||||
@@ -10,6 +12,17 @@
|
||||
* PrimeNG components can continue to use Prime's --p-* tokens.
|
||||
*/
|
||||
|
||||
@mixin sidebar-fixed-overlay {
|
||||
position: fixed !important;
|
||||
top: var(--sidebar-popover-top, 0.75rem) !important;
|
||||
bottom: auto !important;
|
||||
left: var(--sidebar-popover-left, calc(var(--sidebar-width, 225px) + 0.5rem)) !important;
|
||||
max-height: var(--sidebar-popover-max-height, calc(100vh - 1rem)) !important;
|
||||
margin: 0 !important;
|
||||
overflow: auto !important;
|
||||
transform: none !important;
|
||||
}
|
||||
|
||||
.p-dialog {
|
||||
--card-background: var(--surface-content);
|
||||
|
||||
@@ -156,12 +169,7 @@
|
||||
.sidebar-flyout-popover.p-popover,
|
||||
.sidebar-more-menu.p-menu,
|
||||
.sidebar-user-menu.p-menu {
|
||||
position: fixed !important;
|
||||
top: auto !important;
|
||||
bottom: var(--sidebar-popover-bottom, 0.75rem) !important;
|
||||
left: var(--sidebar-popover-left, calc(var(--sidebar-width, 225px) + 0.5rem)) !important;
|
||||
margin: 0 !important;
|
||||
transform: none !important;
|
||||
@include sidebar-fixed-overlay;
|
||||
|
||||
&::before,
|
||||
&::after {
|
||||
@@ -248,3 +256,43 @@
|
||||
font-weight: 500;
|
||||
}
|
||||
}
|
||||
|
||||
@media #{variables.$mobile-shell-media-query} {
|
||||
.sidebar-entity-menu.p-menu {
|
||||
@include sidebar-fixed-overlay;
|
||||
|
||||
.p-menu-submenu-label {
|
||||
display: none !important;
|
||||
}
|
||||
}
|
||||
|
||||
.sidebar-entity-menu.p-menu,
|
||||
.sidebar-more-menu.p-menu,
|
||||
.sidebar-user-menu.p-menu,
|
||||
.sidebar-flyout-popover.p-popover .p-menu,
|
||||
.sidebar-flyout-popover.p-popover .p-tieredmenu {
|
||||
> .p-menu-list,
|
||||
.p-menu-list,
|
||||
> .p-tieredmenu-root-list,
|
||||
.p-tieredmenu-root-list,
|
||||
.p-tieredmenu-submenu {
|
||||
padding-block: var(--space-2) !important;
|
||||
}
|
||||
|
||||
.p-menu-item-content > .p-menu-item-link,
|
||||
.p-menu-item-link,
|
||||
.p-tieredmenu-item-content > .p-tieredmenu-item-link,
|
||||
.p-tieredmenu-item-link {
|
||||
min-height: 3rem !important;
|
||||
padding: var(--space-3) var(--space-4) !important;
|
||||
gap: var(--space-3) !important;
|
||||
}
|
||||
}
|
||||
|
||||
.sidebar-user-menu.p-menu {
|
||||
.sidebar-user-menu-header,
|
||||
.sidebar-user-menu-footer {
|
||||
padding: var(--space-3) var(--space-4);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user