Files
design-system/src/design-system/layout/Sidebar/Sidebar.module.css

511 lines
8.8 KiB
CSS
Raw Normal View History

.sidebar {
width: 260px;
flex-shrink: 0;
background: var(--sidebar-bg);
display: flex;
flex-direction: column;
overflow: hidden;
}
/* Logo */
.logo {
padding: 16px 18px;
display: flex;
align-items: center;
gap: 10px;
border-bottom: 1px solid rgba(255, 255, 255, 0.06);
flex-shrink: 0;
}
.logoImg {
width: 28px;
height: 24px;
color: var(--amber-light);
filter: brightness(0) saturate(100%) invert(76%) sepia(30%) saturate(400%) hue-rotate(5deg) brightness(95%);
}
.brand {
font-family: var(--font-mono);
font-weight: 600;
font-size: 15px;
color: var(--amber-light);
letter-spacing: -0.3px;
}
.version {
font-family: var(--font-mono);
font-size: 10px;
color: var(--sidebar-muted);
margin-left: 4px;
}
/* Search */
.searchWrap {
padding: 10px 12px;
flex-shrink: 0;
}
.searchInner {
position: relative;
}
.searchInput {
width: 100%;
background: rgba(255, 255, 255, 0.06);
border: 1px solid rgba(255, 255, 255, 0.08);
border-radius: var(--radius-sm);
padding: 6px 26px 6px 28px;
color: var(--sidebar-text);
font-family: var(--font-body);
font-size: 12px;
outline: none;
transition: border-color 0.15s;
}
.searchInput::placeholder {
color: var(--sidebar-muted);
}
.searchInput:focus {
border-color: rgba(198, 130, 14, 0.4);
}
.searchIcon {
position: absolute;
left: 9px;
top: 50%;
transform: translateY(-50%);
color: var(--sidebar-muted);
display: flex;
align-items: center;
}
.searchClear {
position: absolute;
right: 4px;
top: 50%;
transform: translateY(-50%);
width: 20px;
height: 20px;
display: flex;
align-items: center;
justify-content: center;
border: none;
background: none;
color: var(--sidebar-muted);
font-size: 14px;
cursor: pointer;
border-radius: var(--radius-sm);
padding: 0;
line-height: 1;
transition: color 0.1s, background 0.1s;
}
.searchClear:hover {
color: var(--sidebar-text);
background: rgba(255, 255, 255, 0.08);
}
/* Scrollable nav area */
.navArea {
flex: 1;
overflow-y: auto;
min-height: 0;
}
/* Section headers */
.section {
padding: 14px 12px 5px;
font-size: 10px;
font-weight: 600;
text-transform: uppercase;
letter-spacing: 1.2px;
color: var(--sidebar-muted);
}
/* Items container */
.items {
padding: 0 6px;
}
/* Nav item (flat links like Dashboards) */
.item {
display: flex;
align-items: center;
gap: 10px;
padding: 7px 12px;
border-radius: var(--radius-sm);
color: var(--sidebar-text);
font-size: 13px;
cursor: pointer;
transition: all 0.12s;
border-left: 3px solid transparent;
margin-bottom: 1px;
user-select: none;
}
.item:hover {
background: var(--sidebar-hover);
color: #e8dfd4;
}
.item.active {
background: var(--sidebar-active);
color: var(--amber-light);
border-left-color: var(--amber);
}
.navIcon {
font-size: 14px;
width: 18px;
text-align: center;
color: var(--sidebar-muted);
flex-shrink: 0;
}
.item.active .navIcon {
color: var(--amber-light);
}
.routeArrow {
color: var(--sidebar-muted);
font-size: 10px;
flex-shrink: 0;
}
/* Item sub-elements */
.itemInfo {
flex: 1;
min-width: 0;
}
.itemName {
font-weight: 500;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
/* No results */
.noResults {
padding: 16px 18px;
font-size: 12px;
color: var(--sidebar-muted);
text-align: center;
}
/* ── SidebarTree styles ──────────────────────────────────────────────────── */
.treeSection {
padding: 0 6px;
margin-bottom: 4px;
}
.treeSectionLabel {
padding: 10px 12px 4px;
font-size: 10px;
font-weight: 600;
text-transform: uppercase;
letter-spacing: 1px;
color: var(--sidebar-muted);
}
/* Collapsible section toggle */
.treeSectionToggle {
display: flex;
align-items: center;
gap: 2px;
width: 100%;
padding: 8px 0 4px;
}
.treeSectionChevronBtn {
background: none;
border: none;
padding: 2px 4px;
margin: 0;
color: var(--sidebar-muted);
font-size: 9px;
cursor: pointer;
display: flex;
align-items: center;
justify-content: center;
transition: color 0.12s;
}
.treeSectionChevronBtn:hover {
color: var(--sidebar-text);
}
.treeSectionLabel {
font-size: 10px;
font-weight: 600;
text-transform: uppercase;
letter-spacing: 1px;
color: var(--sidebar-muted);
cursor: pointer;
transition: color 0.12s;
}
.treeSectionLabel:hover {
color: var(--amber-light);
}
.treeSectionLabelActive {
color: var(--amber-light);
}
.tree {
list-style: none;
margin: 0;
padding: 0;
}
.treeGroup {
list-style: none;
margin: 0;
padding: 0;
}
.treeRow {
display: flex;
align-items: center;
gap: 6px;
padding: 5px 8px;
border-radius: var(--radius-sm);
color: var(--sidebar-text);
font-size: 12px;
cursor: pointer;
transition: background 0.12s;
border-left: 3px solid transparent;
margin-bottom: 1px;
user-select: none;
position: relative;
}
.treeRow:hover {
background: var(--sidebar-hover);
}
.treeRowActive {
background: var(--sidebar-active);
color: var(--amber-light);
border-left-color: var(--amber);
}
.treeRowActive .treeBadge {
background: rgba(198, 130, 14, 0.2);
color: var(--amber-light);
}
/* Chevron */
.treeChevronSlot {
width: 14px;
flex-shrink: 0;
display: flex;
align-items: center;
justify-content: center;
}
.treeChevron {
background: none;
border: none;
padding: 0;
margin: 0;
color: var(--sidebar-muted);
font-size: 11px;
cursor: pointer;
line-height: 1;
display: flex;
align-items: center;
justify-content: center;
}
.treeChevron:hover {
color: var(--sidebar-text);
}
/* Icon slot */
.treeIcon {
flex-shrink: 0;
display: flex;
align-items: center;
}
/* Label */
.treeLabel {
flex: 1;
min-width: 0;
font-weight: 500;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
/* Badge */
.treeBadge {
font-family: var(--font-mono);
font-size: 10px;
color: var(--sidebar-muted);
background: rgba(255, 255, 255, 0.06);
padding: 1px 6px;
border-radius: 10px;
flex-shrink: 0;
white-space: nowrap;
}
/* Star button */
.treeStar {
background: none;
border: none;
padding: 0;
margin: 0;
color: var(--sidebar-muted);
cursor: pointer;
opacity: 0;
transition: opacity 0.15s, color 0.15s;
display: flex;
align-items: center;
flex-shrink: 0;
}
.treeStarActive {
opacity: 1;
color: var(--amber);
}
.treeRow:hover .treeStar {
opacity: 1;
}
.treeStar:hover {
color: var(--amber-light);
}
/* ── Starred section ─────────────────────────────────────────────────────── */
.starredSection {
border-top: 1px solid rgba(255, 255, 255, 0.06);
margin-top: 4px;
}
.starredHeader {
color: var(--amber);
}
.starredList {
padding: 0 6px 6px;
}
.starredGroup {
margin-bottom: 4px;
}
.starredGroupLabel {
padding: 4px 12px 2px;
font-size: 10px;
color: var(--sidebar-muted);
font-weight: 500;
}
.starredItem {
display: flex;
align-items: center;
gap: 8px;
padding: 4px 12px;
border-radius: var(--radius-sm);
color: var(--sidebar-text);
font-size: 12px;
cursor: pointer;
transition: background 0.12s;
user-select: none;
}
.starredItem:hover {
background: var(--sidebar-hover);
}
.starredItemInfo {
flex: 1;
min-width: 0;
display: flex;
flex-direction: column;
}
.starredItemName {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
font-weight: 500;
}
.starredItemContext {
font-size: 10px;
color: var(--sidebar-muted);
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
/* Remove button */
.starredRemove {
background: none;
border: none;
padding: 2px;
margin: 0;
color: var(--sidebar-muted);
cursor: pointer;
opacity: 0;
transition: opacity 0.15s, color 0.15s;
display: flex;
align-items: center;
flex-shrink: 0;
}
.starredItem:hover .starredRemove {
opacity: 1;
}
.starredRemove:hover {
color: var(--error);
}
/* ── Bottom links ────────────────────────────────────────────────────────── */
.bottom {
border-top: 1px solid rgba(255, 255, 255, 0.06);
padding: 6px;
flex-shrink: 0;
}
.bottomItem {
display: flex;
align-items: center;
gap: 10px;
padding: 7px 12px;
border-radius: var(--radius-sm);
color: var(--sidebar-muted);
font-size: 12px;
cursor: pointer;
transition: all 0.12s;
border-left: 3px solid transparent;
margin-bottom: 1px;
}
.bottomItem:hover {
background: var(--sidebar-hover);
color: var(--sidebar-text);
}
.bottomItemActive {
background: var(--sidebar-active);
color: var(--amber-light);
border-left-color: var(--amber);
}
.bottomIcon {
font-size: 13px;
width: 18px;
text-align: center;
}