239 lines
4.3 KiB
CSS
239 lines
4.3 KiB
CSS
body {
|
|
display: grid;
|
|
grid-template-columns: var(--sidebar-w) 1fr;
|
|
grid-template-rows: var(--topnav-h) 1fr;
|
|
grid-template-areas:
|
|
"sidebar topnav"
|
|
"sidebar main";
|
|
height: 100dvh;
|
|
}
|
|
|
|
body.sidebar-collapsed {
|
|
grid-template-columns: var(--sidebar-w-collapsed) 1fr;
|
|
}
|
|
|
|
/* ===== Sidebar ===== */
|
|
aside {
|
|
grid-area: sidebar;
|
|
background: var(--surface-white);
|
|
border-right: 1px solid var(--outline-dim);
|
|
display: flex;
|
|
flex-direction: column;
|
|
padding: var(--space-md);
|
|
gap: var(--space-sm);
|
|
overflow: hidden;
|
|
z-index: 40;
|
|
transition: width 0.2s ease, padding 0.2s ease;
|
|
}
|
|
|
|
aside > .collapse-btn {
|
|
background: none;
|
|
border: none;
|
|
cursor: pointer;
|
|
color: var(--on-surface-dim);
|
|
padding: var(--space-xs);
|
|
border-radius: var(--radius-sm);
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
flex-shrink: 0;
|
|
width: 2rem;
|
|
height: 2rem;
|
|
}
|
|
|
|
aside > .collapse-btn:hover {
|
|
background: var(--surface-highest);
|
|
color: var(--on-surface);
|
|
}
|
|
|
|
aside > .cta {
|
|
width: 100%;
|
|
height: 2.5rem;
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
gap: var(--space-sm);
|
|
background: var(--primary);
|
|
color: var(--on-primary);
|
|
border: none;
|
|
border-radius: var(--radius-md);
|
|
font-size: 0.875rem;
|
|
font-weight: 600;
|
|
cursor: pointer;
|
|
text-decoration: none;
|
|
transition: opacity var(--transition);
|
|
}
|
|
|
|
aside > .cta:hover {
|
|
opacity: 0.9;
|
|
}
|
|
|
|
aside > nav {
|
|
flex: 1;
|
|
display: flex;
|
|
flex-direction: column;
|
|
gap: var(--space-xs);
|
|
}
|
|
|
|
aside > nav > a {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: var(--space-sm);
|
|
padding: var(--space-sm) var(--space-md);
|
|
border-radius: var(--radius-md);
|
|
font-size: 0.875rem;
|
|
font-weight: 500;
|
|
text-decoration: none;
|
|
color: var(--on-surface-dim);
|
|
transition: all var(--transition);
|
|
}
|
|
|
|
aside > nav > a:hover {
|
|
background: var(--surface-low);
|
|
color: var(--on-surface);
|
|
}
|
|
|
|
aside > nav > a.active {
|
|
background: var(--primary-container);
|
|
color: var(--primary);
|
|
font-weight: 700;
|
|
}
|
|
|
|
body.sidebar-collapsed aside {
|
|
width: var(--sidebar-w-collapsed);
|
|
padding: var(--space-xs);
|
|
align-items: center;
|
|
}
|
|
|
|
body.sidebar-collapsed aside > .cta {
|
|
width: 2.5rem;
|
|
height: 2.5rem;
|
|
padding: 0;
|
|
border-radius: 50%;
|
|
}
|
|
|
|
body.sidebar-collapsed aside > .cta span:not(.material-symbols-outlined) {
|
|
display: none;
|
|
}
|
|
|
|
body.sidebar-collapsed aside > nav > a {
|
|
justify-content: center;
|
|
padding: var(--space-sm);
|
|
}
|
|
|
|
body.sidebar-collapsed aside > nav > a span:not(.material-symbols-outlined) {
|
|
display: none;
|
|
}
|
|
|
|
/* ===== Topnav ===== */
|
|
.topnav {
|
|
grid-area: topnav;
|
|
border-bottom: 1px solid var(--outline-dim);
|
|
background: var(--surface);
|
|
display: flex;
|
|
align-items: center;
|
|
gap: var(--space-lg);
|
|
padding: 0 var(--space-lg);
|
|
flex-shrink: 0;
|
|
position: sticky;
|
|
top: 0;
|
|
z-index: 30;
|
|
}
|
|
|
|
.topnav > h1 {
|
|
margin-right: auto;
|
|
}
|
|
|
|
.topnav > .search {
|
|
position: relative;
|
|
width: 15rem;
|
|
}
|
|
|
|
.topnav > .search input {
|
|
height: 2rem;
|
|
padding-left: 2rem;
|
|
font-size: 0.875rem;
|
|
}
|
|
|
|
.topnav > .search .material-symbols-outlined {
|
|
position: absolute;
|
|
left: var(--space-sm);
|
|
top: 50%;
|
|
transform: translateY(-50%);
|
|
font-size: 1.25rem;
|
|
color: var(--on-surface-dim);
|
|
pointer-events: none;
|
|
}
|
|
|
|
/* ===== Main ===== */
|
|
main {
|
|
grid-area: main;
|
|
overflow-y: auto;
|
|
}
|
|
|
|
.main-content {
|
|
padding: var(--space-md);
|
|
display: flex;
|
|
flex-direction: column;
|
|
gap: var(--space-md);
|
|
min-height: 0;
|
|
flex: 1;
|
|
}
|
|
|
|
/* ===== Responsive ===== */
|
|
@media (max-width: 64em) {
|
|
.topnav > .search {
|
|
width: 10rem;
|
|
}
|
|
}
|
|
|
|
@media (max-width: 48em) {
|
|
aside {
|
|
width: var(--sidebar-w-collapsed);
|
|
padding: var(--space-xs);
|
|
align-items: center;
|
|
}
|
|
|
|
aside > .cta {
|
|
width: 2.5rem;
|
|
height: 2.5rem;
|
|
padding: 0;
|
|
border-radius: 50%;
|
|
}
|
|
|
|
aside > .cta span:not(.material-symbols-outlined) {
|
|
display: none;
|
|
}
|
|
|
|
aside > nav > a {
|
|
justify-content: center;
|
|
padding: var(--space-sm);
|
|
}
|
|
|
|
aside > nav > a span:not(.material-symbols-outlined) {
|
|
display: none;
|
|
}
|
|
|
|
body.sidebar-collapsed aside {
|
|
width: 0;
|
|
padding: 0;
|
|
overflow: hidden;
|
|
border-right: none;
|
|
}
|
|
|
|
body.sidebar-collapsed {
|
|
grid-template-columns: 0 1fr;
|
|
}
|
|
|
|
.topnav {
|
|
padding: 0 var(--space-sm);
|
|
}
|
|
|
|
.topnav > .search {
|
|
display: none;
|
|
}
|
|
|
|
.main-content {
|
|
padding: var(--space-sm);
|
|
}
|
|
}
|