Files
plainleaf/client/styles/top.scss
T
2026-04-21 16:29:38 +02:00

220 lines
4.2 KiB
SCSS

#sb-top {
display: flex;
flex-direction: row;
z-index: 20;
height: 55px;
.main {
flex: 2;
max-width: 100%;
.inner {
// Hack to not have SCSS precompile this value but use proper CSS variables
max-width: var(--#{"editor-width"});
margin: auto;
font-size: 28px;
padding: 8px 0;
display: flex;
flex-direction: row;
.wrapper {
width: env(titlebar-area-width, 100%);
padding: 0 20px;
display: flex;
box-sizing: border-box;
position: relative;
}
}
#sb-current-page {
flex: 1;
overflow: hidden;
white-space: nowrap;
text-align: left;
display: block;
-webkit-app-region: drag;
.cm-scroller {
font-family: var(--ui-font);
overflow-x: hidden;
}
.cm-content {
padding: 0;
.cm-line {
padding: 0;
caret-color: var(--editor-caret-color);
}
}
}
}
.sb-actions {
display: flex;
flex: 0 0 auto;
text-align: right;
&.hamburger button.expander {
display: none;
}
}
.progress-wrapper {
position: relative;
margin-top: 4px;
margin-right: 6px;
padding: 4px;
background-color: var(--top-background-color);
}
.progress-bar {
display: flex;
justify-content: center;
align-items: center;
width: 24px;
height: 24px;
border-radius: 50%;
font-size: 8px;
}
}
@media only screen and (max-width: 600px) {
/* Style the menu as a vertical fly-out */
#sb-top .cm-scroller:has(.hamburger) {
position: relative;
}
#sb-top .sb-actions.hamburger {
width: 2.8rem;
margin-top: 2px;
background: color-mix(
in srgb,
var(--top-background-color) 90%,
transparent
);
backdrop-filter: blur(20px);
overflow: hidden;
flex-direction: column;
align-items: center;
z-index: 10;
transition:
max-height 0.3s ease-in-out,
box-shadow 0.3s ease-in-out;
/* Initial collapsed height */
max-height: 2.2rem;
button {
&.expander {
display: initial;
}
&:not(.sb-code-copy-button) {
display: block;
height: 1.8rem;
text-align: center;
margin: 4px 0;
padding: 4px 0;
}
&:not(:first-of-type) {
margin: 8px 0;
opacity: 0;
transform: translateY(-10px);
transition:
opacity 0.3s ease-in-out,
transform 0.3s ease-in-out;
}
}
// CSS class for toggling the hamburger menu, so it can be toggled via JS
&.open:hover {
/* Expanded height limited to the viewport height minus some padding */
max-height: calc(100vh - 24px);
button {
opacity: 1;
transform: translateY(0) translateX(0);
}
}
}
/* Style the menu as a bottom bar */
#sb-top .sb-actions.bottom-bar {
position: fixed;
bottom: 0;
left: 0;
padding: 10px 0;
background: var(--top-background-color);
width: 100vw;
box-shadow: 0px 4px 8px black;
justify-content: space-around;
button {
padding: 1em;
margin: 0;
height: unset;
width: unset;
svg {
margin-bottom: -5px;
}
}
}
}
// Rendered via portal into document.body, so it sits outside #sb-top's
// stacking context and can render above the modal (z-index 100).
.sb-notifications {
position: fixed;
left: max(20px, calc((100vw - var(--#{"editor-width"})) / 2 + 20px));
right: max(20px, calc((100vw - var(--#{"editor-width"})) / 2 + 20px));
top: 60px;
font-size: 15px;
z-index: 1000;
display: flex;
flex-direction: column;
align-items: flex-end;
> div {
padding: 3px 8px;
margin-bottom: 3px;
border-radius: 5px;
display: flex;
align-items: center;
gap: 8px;
}
.sb-notification-actions {
display: flex;
gap: 4px;
flex-shrink: 0;
.sb-button {
font-size: 0.85em;
padding: 1px 6px;
white-space: nowrap;
}
}
.sb-notification-dismiss {
background: none;
border: none;
color: inherit;
cursor: pointer;
font-size: 1.1em;
padding: 0 2px;
opacity: 0.7;
&:hover {
opacity: 1;
}
}
}