refactor(css): maximize usage of variables (1st part, to simplify CSS & style)

note: there is still work to do, but has there are risks to conflict I prefer to commit this first part now
This commit is contained in:
Edouard Vanbelle
2026-04-08 11:03:20 +02:00
parent 904aca5edf
commit 94b36e41e0
35 changed files with 2957 additions and 2535 deletions
+12 -12
View File
@@ -10,7 +10,7 @@
font-size: 24px;
font-weight: bold;
margin-bottom: 20px;
color: #2d3748;
color: var(--color-text);
}
.page-sticky-header {
@@ -42,7 +42,7 @@
justify-content: center;
padding: 40px;
text-align: center;
color: #888;
color: var(--color-content-muted);
width: 100%;
height: 300px;
grid-column: 1 / -1;
@@ -66,7 +66,7 @@
overflow: hidden;
border-radius: 10px;
width: 100%;
/*box-shadow: 0 1px 3px rgba(0,0,0,0.05);*/
/*box-shadow: 0 1px 3px var(--color-shadow-xs);*/
}
.dragged-items .file-item {
@@ -74,9 +74,9 @@
grid-template-columns: var(--dragged-files-list-columns);
column-gap: 12px;
padding: 12px 15px;
/*border-bottom: 1px solid #f0f0f0;*/
/*border-bottom: 1px solid var(--color-border-xfaint);*/
align-items: center;
background-color: white;
background-color: var(--color-bg-surface);
}
.dragged-items .file-item {
@@ -94,7 +94,7 @@
}
.dragged-items .file-item .file-icon {
background-color: #ffeaa7;
background-color: var(--color-warning-bg);
position: relative;
width: 36px;
height: 36px;
@@ -102,7 +102,7 @@
}
.dragged-items .file-item .file-icon.folder-icon {
background-color: #ffeaa7;
background-color: var(--color-warning-bg);
position: relative;
width: 36px;
height: 36px;
@@ -115,7 +115,7 @@
left: 0;
right: 0;
height: 8px;
background-color: #fdcb6e;
background-color: var(--color-warning-bg-dark);
border-radius: 8px 8px 0 0;
}
@@ -125,8 +125,8 @@
}
.dragged-items div.fading {
-webkit-mask-image: linear-gradient(to bottom, white 10%, transparent);
mask-image: linear-gradient(to bottom, white 10%, transparent);
-webkit-mask-image: linear-gradient(to bottom, var(--color-bg-surface) 10%, transparent);
mask-image: linear-gradient(to bottom, var(--color-bg-surface) 10%, transparent);
}
.dragged-items-badge {
@@ -136,8 +136,8 @@
transform: translate(50%, -50%);
background: red;
color: white;
background: var(--color-content-debug-bg);
color: var(--color-content-debug-text);
border-radius: 50%;
min-width: 20px;
+35 -35
View File
@@ -1,13 +1,13 @@
/* Sidebar */
.sidebar {
width: 250px;
background: linear-gradient(180deg, #2a3042 0%, #232838 100%);
color: #fff;
background: linear-gradient(180deg, var(--color-sidebar-bg-from) 0%, var(--color-sidebar-bg-to) 100%);
color: var(--color-sidebar-text-active);
display: flex;
flex-direction: column;
height: 100%;
flex-shrink: 0;
box-shadow: 2px 0 12px rgba(0, 0, 0, 0.15);
box-shadow: 2px 0 12px var(--color-shadow-md);
transition: transform 0.3s ease;
}
@@ -19,7 +19,7 @@
left: 0;
right: 0;
bottom: 0;
background: rgba(0, 0, 0, 0.5);
background: var(--color-sidebar-overlay);
z-index: 998;
opacity: 0;
transition: opacity 0.3s ease;
@@ -59,7 +59,7 @@
padding: 22px 20px;
display: flex;
align-items: center;
border-bottom: 1px solid rgba(255, 255, 255, 0.07);
border-bottom: 1px solid var(--color-sidebar-separator);
margin-bottom: 8px;
text-decoration: none;
color: inherit;
@@ -68,13 +68,13 @@
.logo {
width: 40px;
height: 40px;
background: linear-gradient(135deg, #ff5e3a 0%, #ff8a5c 100%);
background: var(--color-sidebar-logo-gradient);
border-radius: 12px;
display: flex;
align-items: center;
justify-content: center;
margin-right: 12px;
box-shadow: 0 3px 10px rgba(255, 94, 58, 0.35);
box-shadow: 0 3px 10px var(--color-sidebar-shadow);
transition:
transform 0.2s,
box-shadow 0.2s;
@@ -87,19 +87,19 @@
.logo:hover {
transform: scale(1.05);
box-shadow: 0 4px 14px rgba(255, 94, 58, 0.45);
box-shadow: 0 4px 14px var(--color-sidebar-shadow-lg);
}
.logo svg {
width: 22px;
height: 22px;
fill: white;
fill: var(--color-sidebar-text-active);
}
.app-name {
font-size: 19px;
font-weight: 700;
color: white;
color: var(--color-sidebar-text-active);
letter-spacing: 0.3px;
}
@@ -117,7 +117,7 @@
padding: 11px 14px;
border-radius: 10px;
cursor: pointer;
color: rgba(255, 255, 255, 0.65);
color: var(--color-sidebar-text);
font-size: 14.5px;
font-weight: 500;
transition: all 0.2s ease;
@@ -131,19 +131,19 @@
}
.nav-item:hover {
background-color: rgba(255, 255, 255, 0.06);
color: rgba(255, 255, 255, 0.9);
background-color: var(--color-sidebar-hover-bg);
color: var(--color-sidebar-text-hover);
}
.nav-item.active {
background-color: rgba(255, 94, 58, 0.12);
color: #fff;
border-left-color: #ff5e3a;
background-color: var(--color-sidebar-active-bg);
color: var(--color-sidebar-text-active);
border-left-color: var(--color-accent);
font-weight: 600;
[dir="rtl"] & {
border-left-color: transparent;
border-right-color: #ff5e3a;
border-right-color: var(--color-accent);
}
}
@@ -169,52 +169,52 @@
/* Colored icons per section */
.nav-item:nth-child(1) i,
.nav-item:nth-child(1) .oxi-icon {
color: #ffa94d;
color: var(--color-cal-1);
} /* Files - orange */
.nav-item:nth-child(2) i,
.nav-item:nth-child(2) .oxi-icon {
color: #74b9ff;
color: var(--color-cal-2);
} /* Shared - blue */
.nav-item:nth-child(3) i,
.nav-item:nth-child(3) .oxi-icon {
color: #81ecec;
color: var(--color-cal-3);
} /* Recent - teal */
.nav-item:nth-child(4) i,
.nav-item:nth-child(4) .oxi-icon {
color: #ffd43b;
color: var(--color-cal-4);
} /* Favorites - gold */
.nav-item:nth-child(5) i,
.nav-item:nth-child(5) .oxi-icon {
color: #ff6b9d;
color: var(--color-cal-5);
} /* Photos - pink */
.nav-item:nth-child(6) i,
.nav-item:nth-child(6) .oxi-icon {
color: #ff7675;
color: var(--color-cal-6);
} /* Trash - red */
.nav-item.active:nth-child(1) i,
.nav-item.active:nth-child(1) .oxi-icon {
color: #ff5e3a;
color: var(--color-accent);
}
.nav-item.active:nth-child(2) i,
.nav-item.active:nth-child(2) .oxi-icon {
color: #0984e3;
color: var(--color-cal-7);
}
.nav-item.active:nth-child(3) i,
.nav-item.active:nth-child(3) .oxi-icon {
color: #00cec9;
color: var(--color-cal-8);
}
.nav-item.active:nth-child(4) i,
.nav-item.active:nth-child(4) .oxi-icon {
color: #f0c800;
color: var(--color-cal-9);
}
.nav-item.active:nth-child(5) i,
.nav-item.active:nth-child(5) .oxi-icon {
color: #e84393;
color: var(--color-cal-10);
}
.nav-item.active:nth-child(6) i,
.nav-item.active:nth-child(6) .oxi-icon {
color: #e74c3c;
color: var(--color-cal-11);
}
.nav-item:hover i,
@@ -225,8 +225,8 @@
/* Storage indicator */
.storage-container {
margin: auto 12px 16px 12px;
background: rgba(255, 255, 255, 0.05);
border: 1px solid rgba(255, 255, 255, 0.07);
background: var(--color-sidebar-storage-bg);
border: 1px solid var(--color-sidebar-storage-border);
border-radius: 12px;
padding: 16px;
}
@@ -239,13 +239,13 @@
margin-bottom: 12px;
font-size: 13px;
font-weight: 600;
color: rgba(255, 255, 255, 0.8);
color: var(--color-sidebar-storage-text);
letter-spacing: 0.3px;
}
.storage-bar {
height: 6px;
background-color: rgba(255, 255, 255, 0.1);
background-color: var(--color-sidebar-storage-bar);
border-radius: 3px;
overflow: hidden;
margin-bottom: 10px;
@@ -253,7 +253,7 @@
.storage-fill {
height: 100%;
background: linear-gradient(90deg, #ff5e3a 0%, #ff8a5c 100%);
background: var(--color-sidebar-progress);
border-radius: 3px;
width: 0%;
transition: width 0.8s ease;
@@ -262,6 +262,6 @@
.storage-info {
text-align: center;
font-size: 11.5px;
color: rgba(255, 255, 255, 0.5);
color: var(--color-sidebar-storage-faint);
font-weight: 400;
}
+20 -20
View File
@@ -11,8 +11,8 @@
height: 70px;
min-height: 70px;
max-height: 70px;
background-color: white;
border-bottom: 1px solid #e6e6e6;
background-color: var(--color-bg-surface);
border-bottom: 1px solid var(--color-border);
display: flex;
align-items: center;
padding: 0 30px;
@@ -27,7 +27,7 @@
border: none;
padding: 10px;
cursor: pointer;
color: #4a5568;
color: var(--color-text-secondary);
border-radius: 8px;
transition:
background-color 0.2s,
@@ -37,8 +37,8 @@
}
.sidebar-toggle:hover {
background-color: #f7fafc;
color: #ff5e3a;
background-color: var(--color-bg-alt);
color: var(--color-accent);
}
.sidebar-toggle i {
@@ -76,28 +76,28 @@
width: 100%;
padding: 12px 50px 12px 44px;
border-radius: 12px;
border: 2px solid #e2e8f0;
background-color: #f8fafc;
border: 2px solid var(--color-border);
background-color: var(--color-bg-hover);
font-size: 14px;
height: 46px;
color: #1a202c;
color: var(--color-text-heading);
transition: all 0.2s ease;
}
.search-container input:hover {
border-color: #cbd5e0;
background-color: #fff;
border-color: var(--color-border-medium);
background-color: var(--color-bg-surface);
}
.search-container input:focus {
outline: none;
border-color: #ff5e3a;
background-color: #fff;
box-shadow: 0 0 0 4px rgba(255, 94, 58, 0.1);
border-color: var(--color-accent);
background-color: var(--color-bg-surface);
box-shadow: 0 0 0 4px var(--color-accent-ring);
}
.search-container input::placeholder {
color: #a0aec0;
color: var(--color-text-placeholder);
}
.search-icon {
@@ -105,7 +105,7 @@
left: 16px;
top: 50%;
transform: translateY(-50%);
color: #a0aec0;
color: var(--color-text-placeholder);
font-size: 16px;
pointer-events: none;
transition: color 0.2s ease;
@@ -118,7 +118,7 @@
.search-container input:focus + .search-icon,
.search-container:focus-within .search-icon {
color: #ff5e3a;
color: var(--color-accent);
}
.search-button {
@@ -126,8 +126,8 @@
right: 6px;
top: 50%;
transform: translateY(-50%);
background: linear-gradient(135deg, #ff5e3a 0%, #ff2d55 100%);
color: white;
background: var(--color-accent-gradient);
color: var(--color-danger-text);
border: none;
border-radius: 10px;
width: 36px;
@@ -137,7 +137,7 @@
align-items: center;
justify-content: center;
transition: all 0.2s ease;
box-shadow: 0 2px 8px rgba(255, 94, 58, 0.3);
box-shadow: 0 2px 8px var(--color-accent-shadow);
[dir="rtl"] & {
left: 6px;
@@ -147,7 +147,7 @@
.search-button:hover {
transform: translateY(-50%) scale(1.05);
box-shadow: 0 4px 12px rgba(255, 94, 58, 0.4);
box-shadow: 0 4px 12px var(--color-accent-shadow-lg);
}
.search-button:active {