Files
tolaria/src/components/Sidebar.css
lucaronin b5971c9618 Add light/dark mode toggle with CSS variables
Replace all hardcoded colors across 10 CSS files with CSS variables defined
in index.css. Dark mode (default) uses the existing navy/purple palette,
light mode uses Notion-inspired warm neutrals from the design tokens
(--bg-primary: #FFFFFF, --bg-sidebar: #F7F6F3, --text-primary: #37352F).

Toggle button (sun/moon) in the sidebar header persists preference to
localStorage. An inline script in index.html applies the saved theme
before React mounts to prevent flash.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-15 10:34:59 +01:00

230 lines
4.1 KiB
CSS

.sidebar {
background: var(--bg-sidebar);
color: var(--text-primary);
display: flex;
flex-direction: column;
overflow-y: auto;
height: 100%;
}
.sidebar__header {
padding: 12px 16px;
padding-left: 78px; /* space for macOS traffic light buttons */
border-bottom: 1px solid var(--border-primary);
flex-shrink: 0;
-webkit-app-region: drag;
app-region: drag;
display: flex;
align-items: center;
justify-content: space-between;
}
.sidebar__header h2 {
margin: 0;
font-size: 17px;
font-weight: 700;
color: var(--text-heading);
letter-spacing: -0.01em;
}
.sidebar__header button {
-webkit-app-region: no-drag;
app-region: no-drag;
}
.sidebar__theme-toggle {
background: none;
border: none;
color: var(--text-tertiary);
cursor: pointer;
font-size: 16px;
padding: 4px 6px;
border-radius: 6px;
line-height: 1;
transition: all 0.15s;
display: flex;
align-items: center;
justify-content: center;
}
.sidebar__theme-toggle:hover {
background: var(--bg-hover);
color: var(--text-heading);
}
.sidebar__nav {
padding: 8px 0;
flex: 1;
overflow-y: auto;
}
/* Filters */
.sidebar__filters {
padding: 4px 0;
margin-bottom: 8px;
border-bottom: 1px solid var(--border-primary);
}
.sidebar__filter-item {
padding: 6px 16px;
cursor: pointer;
font-size: 13px;
border-radius: 6px;
margin: 1px 6px;
transition: all 0.12s;
color: var(--text-secondary);
}
.sidebar__filter-item:hover {
background: var(--bg-hover);
color: var(--text-primary);
}
.sidebar__filter-item--active {
background: var(--accent-blue-bg);
color: var(--accent-blue);
font-weight: 500;
}
/* Section Groups */
.sidebar__section {
margin-bottom: 4px;
}
.sidebar__section-header {
display: flex;
align-items: center;
padding: 6px 8px;
margin: 0 4px;
border-radius: 4px;
cursor: pointer;
font-size: 11px;
font-weight: 600;
letter-spacing: 0.05em;
color: var(--text-tertiary);
user-select: none;
}
.sidebar__section-header:hover {
background: var(--bg-button);
color: var(--text-secondary);
}
.sidebar__section-header--active {
background: var(--bg-button);
color: var(--text-heading);
}
.sidebar__collapse-btn {
background: none;
border: none;
color: inherit;
font-size: 10px;
cursor: pointer;
padding: 0 4px 0 0;
line-height: 1;
width: 16px;
flex-shrink: 0;
}
.sidebar__section-label {
flex: 1;
}
.sidebar__section-count {
font-size: 10px;
color: var(--text-muted);
margin-right: 4px;
}
.sidebar__add-btn {
background: none;
border: none;
color: var(--text-muted);
font-size: 14px;
cursor: pointer;
padding: 0 2px;
line-height: 1;
border-radius: 3px;
opacity: 0;
transition: opacity 0.15s;
}
.sidebar__section-header:hover .sidebar__add-btn {
opacity: 1;
}
.sidebar__add-btn:hover {
color: var(--text-heading);
background: var(--bg-hover);
}
/* Section items (entity list) */
.sidebar__section-items {
padding: 2px 0;
}
.sidebar__item {
padding: 5px 16px 5px 28px;
cursor: pointer;
font-size: 13px;
border-radius: 6px;
margin: 1px 6px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
color: var(--text-secondary);
transition: all 0.12s;
}
.sidebar__item:hover {
background: var(--bg-hover);
color: var(--text-primary);
}
.sidebar__item--active {
background: var(--accent-blue-bg);
color: var(--accent-blue);
font-weight: 500;
}
/* Topics */
.sidebar__topics {
margin-top: 8px;
padding-top: 8px;
border-top: 1px solid var(--border-primary);
}
.sidebar__topics-header {
padding: 6px 16px;
font-size: 11px;
font-weight: 600;
letter-spacing: 0.05em;
color: var(--text-tertiary);
user-select: none;
}
.sidebar__topic-item {
padding: 5px 16px 5px 28px;
cursor: pointer;
font-size: 13px;
border-radius: 6px;
margin: 1px 6px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
color: var(--text-secondary);
transition: all 0.12s;
}
.sidebar__topic-item:hover {
background: var(--bg-hover);
color: var(--text-primary);
}
.sidebar__topic-item--active {
background: var(--accent-blue-bg);
color: var(--accent-blue);
font-weight: 500;
}