1

Refactor: centraliser les couleurs du thème dans des variables CSS

This commit is contained in:
2025-09-17 10:36:30 +02:00
parent 92ad1acfa1
commit c327f865ea
8 changed files with 125 additions and 78 deletions

View File

@@ -23,7 +23,7 @@ article {
font-size: 0.75rem; font-size: 0.75rem;
color: var(--text-soft); color: var(--text-soft);
background: rgba(0, 0, 0, 0.75); background: var(--overlay-black-75);
padding: 0.4rem 0.6rem; padding: 0.4rem 0.6rem;
border-radius: 6px 6px 0 0; border-radius: 6px 6px 0 0;
pointer-events: none; pointer-events: none;
@@ -39,11 +39,11 @@ article {
max-width: 80ch; max-width: 80ch;
margin: 2rem auto; margin: 2rem auto;
padding: 2rem; padding: 2rem;
background: rgba(30, 30, 30, 1); background: var(--surface-panel-strong);
border-radius: 12px; border-radius: 12px;
box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3), box-shadow: 0 8px 24px var(--overlay-black-30),
inset 0 1px 2px rgba(255, 255, 255, 0.05); inset 0 1px 2px var(--bg-white-05);
border: 1px solid rgba(255, 255, 255, 0.05); border: 1px solid var(--bg-white-05);
} }
} }
@@ -61,10 +61,10 @@ article {
z-index: 1; z-index: 1;
background: linear-gradient(to bottom, background: linear-gradient(to bottom,
rgba(0, 0, 0, 0) 0%, var(--transparent) 0%,
rgba(0, 0, 0, 0) 100vh, var(--transparent) 100vh,
rgba(0, 0, 0, 0.4) 113vh, var(--overlay-black-40) 113vh,
rgba(0, 0, 0, 0.8) 125vh); var(--overlay-black-80) 125vh);
} }
@media (max-width: 768px) { @media (max-width: 768px) {

View File

@@ -23,8 +23,8 @@ body::before {
left: 0; left: 0;
width: 100%; width: 100%;
height: 100%; height: 100%;
background-image: linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px), background-image: linear-gradient(var(--bg-white-02) 1px, var(--transparent) 1px),
linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px); linear-gradient(90deg, var(--bg-white-02) 1px, var(--transparent) 1px);
background-size: 2px 2px; background-size: 2px 2px;
opacity: 0.5; opacity: 0.5;
pointer-events: none; pointer-events: none;

View File

@@ -4,12 +4,12 @@ body>footer {
max-width: 1200px; max-width: 1200px;
margin: 2rem auto 0 auto; margin: 2rem auto 0 auto;
padding: 2rem; padding: 2rem;
background: linear-gradient(to bottom, rgba(15, 15, 15, 1), rgba(1, 1, 1, 1)); background: linear-gradient(to bottom, var(--surface-charcoal), var(--surface-onyx));
border-radius: 2rem 2rem 0 0; border-radius: 2rem 2rem 0 0;
box-shadow: 0 8px 20px rgba(0, 0, 0, 0.6); box-shadow: 0 8px 20px var(--overlay-black-60);
text-align: center; text-align: center;
color: var(--text-dim); color: var(--text-dim);
border-top: 2px solid rgba(255, 255, 255, 0.2); border-top: 2px solid var(--bg-white-20);
p { p {
font-size: 0.85rem; font-size: 0.85rem;
@@ -38,7 +38,7 @@ body>footer {
&:hover { &:hover {
color: var(--text-white); color: var(--text-white);
background: rgba(138, 180, 248, 0.2); background: var(--accent-blue-alpha-20);
border-radius: 3px; border-radius: 3px;
} }
} }
@@ -62,7 +62,7 @@ body>footer {
flex-direction: column; flex-direction: column;
margin-top: 0.5rem; margin-top: 0.5rem;
padding-top: 0.5rem; padding-top: 0.5rem;
border-top: 2px solid rgba(255, 255, 255, 0.15); border-top: 2px solid var(--bg-white-15);
list-style: none; list-style: none;
padding-left: 0; padding-left: 0;
gap: 0.3rem; gap: 0.3rem;

View File

@@ -11,10 +11,10 @@ main>header {
justify-content: space-between; justify-content: space-between;
padding: .5rem 1rem; padding: .5rem 1rem;
background: background:
radial-gradient(circle at top left, rgba(255, 255, 255, 0.12) 0%, rgba(0, 0, 0, 0) 60%), radial-gradient(circle at top left, var(--bg-white-12) 0%, var(--transparent) 60%),
linear-gradient(to bottom, rgba(15, 15, 15, 1), rgba(1, 1, 1, 1)); linear-gradient(to bottom, var(--surface-charcoal), var(--surface-onyx));
border-radius: 0 0 2rem 2rem; border-radius: 0 0 2rem 2rem;
box-shadow: 0 8px 20px rgba(0, 0, 0, 0.6); box-shadow: 0 8px 20px var(--overlay-black-60);
gap: 1rem; gap: 1rem;
.site-logo { .site-logo {
@@ -65,28 +65,28 @@ main>header {
background-image: background-image:
/* Stries métalliques irrégulières */ /* Stries métalliques irrégulières */
repeating-linear-gradient(to right, repeating-linear-gradient(to right,
hsla(0, 0%, 28%, 0.02) 0%, var(--header-metal-stripe-strong) 0%,
hsla(0, 0%, 28%, 0.02) 4%, var(--header-metal-stripe-strong) 4%,
hsla(0, 0%, 32%, 0.04) 5%, var(--header-metal-stripe-highlight) 5%,
hsla(0, 0%, 28%, 0.02) 6%), var(--header-metal-stripe-strong) 6%),
/* Stries secondaires plus douces */ /* Stries secondaires plus douces */
repeating-linear-gradient(to right, repeating-linear-gradient(to right,
hsla(0, 0%, 22%, 0.01) 0%, var(--header-metal-stripe-soft) 0%,
hsla(0, 0%, 22%, 0.01) 2%, var(--header-metal-stripe-soft) 2%,
hsla(0, 0%, 26%, 0.03) 3%, var(--header-metal-stripe-soft-highlight) 3%,
hsla(0, 0%, 22%, 0.01) 4%), var(--header-metal-stripe-soft) 4%),
/* Effet d'ombrage et reflet léger */ /* Effet d'ombrage et reflet léger */
linear-gradient(to bottom, linear-gradient(to bottom,
hsl(0, 0%, 18%) 0%, var(--header-metal-gradient-top) 0%,
hsl(0, 0%, 22%) 47%, var(--header-metal-gradient-mid) 47%,
hsl(0, 0%, 18%) 53%, var(--header-metal-gradient-top) 53%,
hsl(0, 0%, 16%) 100%); var(--header-metal-gradient-bottom) 100%);
background-size: 200px 100%; background-size: 200px 100%;
background-repeat: repeat; background-repeat: repeat;
border-radius: 0 0 1rem 1rem; border-radius: 0 0 1rem 1rem;
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5); box-shadow: 0 4px 12px var(--overlay-black-50);
overflow: hidden; overflow: hidden;
.tablet-links { .tablet-links {
@@ -103,7 +103,7 @@ main>header {
background: var(--surface-elevated); background: var(--surface-elevated);
color: var(--text-light); color: var(--text-light);
text-decoration: none; text-decoration: none;
border: 1px solid transparent; border: 1px solid var(--transparent);
font-size: 0.85rem; font-size: 0.85rem;
line-height: 1; line-height: 1;
transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease; transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
@@ -118,7 +118,7 @@ main>header {
.tablet-link:focus-visible { .tablet-link:focus-visible {
outline: 2px solid var(--accent-blue); outline: 2px solid var(--accent-blue);
outline-offset: 3px; outline-offset: 3px;
border-color: transparent; border-color: var(--transparent);
} }
.tablet-link:focus:not(:focus-visible) { .tablet-link:focus:not(:focus-visible) {
@@ -182,7 +182,7 @@ main>header {
background-color: var(--surface-elevated); background-color: var(--surface-elevated);
border: 1px solid var(--border-panel); border: 1px solid var(--border-panel);
border-radius: 0.5rem; border-radius: 0.5rem;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.4); box-shadow: 0 0 10px var(--overlay-black-40);
overflow: auto; overflow: auto;
padding: 1rem; padding: 1rem;
scrollbar-width: thin; scrollbar-width: thin;

View File

@@ -18,10 +18,10 @@
border-radius: 12px; border-radius: 12px;
overflow: hidden; overflow: hidden;
position: relative; position: relative;
background: linear-gradient(to bottom, rgba(15, 15, 15, 0.9), rgba(1, 1, 1, 0.95)); background: linear-gradient(to bottom, var(--surface-charcoal-90), var(--surface-onyx-95));
border: 1px solid rgba(255, 255, 255, 0.1); border: 1px solid var(--bg-white-10);
border-top: 2px solid rgba(255, 255, 255, 0.2); border-top: 2px solid var(--bg-white-20);
box-shadow: 0 6px 14px rgba(0, 0, 0, 0.5); box-shadow: 0 6px 14px var(--overlay-black-50);
color: inherit; color: inherit;
text-decoration: none; text-decoration: none;
transition: box-shadow 0.2s ease-in-out; transition: box-shadow 0.2s ease-in-out;
@@ -29,7 +29,7 @@
/* Effet léger au survol */ /* Effet léger au survol */
.article-card:hover { .article-card:hover {
box-shadow: 0 8px 18px rgba(0, 0, 0, 0.7); box-shadow: 0 8px 18px var(--overlay-black-70);
} }
/* Image en haut, occupant toute la largeur */ /* Image en haut, occupant toute la largeur */
@@ -38,7 +38,7 @@
background-size: cover; background-size: cover;
background-position: center; background-position: center;
position: relative; position: relative;
border-bottom: 2px solid rgba(255, 255, 255, 0.1); border-bottom: 2px solid var(--bg-white-10);
filter: brightness(0.6); filter: brightness(0.6);
/* Image légèrement plus sombre */ /* Image légèrement plus sombre */
transition: filter 0.2s ease-in-out; transition: filter 0.2s ease-in-out;
@@ -54,7 +54,7 @@
content: ""; content: "";
position: absolute; position: absolute;
inset: 0; inset: 0;
background: linear-gradient(to top, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0)); background: linear-gradient(to top, var(--bg-white-05), var(--transparent));
opacity: 0.4; opacity: 0.4;
} }

View File

@@ -3,10 +3,10 @@
justify-content: space-between; justify-content: space-between;
align-items: center; align-items: center;
padding: .2rem .3rem; padding: .2rem .3rem;
background: linear-gradient(to bottom, rgba(15, 15, 15, 0.9), rgba(1, 1, 1, 0.95)); background: linear-gradient(to bottom, var(--surface-charcoal-90), var(--surface-onyx-95));
border-top: 2px solid rgba(255, 255, 255, 0.2); border-top: 2px solid var(--bg-white-20);
border-radius: 12px; border-radius: 12px;
box-shadow: 0 6px 14px rgba(0, 0, 0, 0.5); box-shadow: 0 6px 14px var(--overlay-black-50);
gap: 1rem; gap: 1rem;
flex-wrap: wrap; flex-wrap: wrap;
@@ -31,7 +31,7 @@
.pagination-bar a:hover { .pagination-bar a:hover {
color: var(--text-white); color: var(--text-white);
background: rgba(138, 180, 248, 0.2); background: var(--accent-blue-alpha-20);
} }
.pagination-bar .disabled { .pagination-bar .disabled {
@@ -50,9 +50,9 @@
&[open] { &[open] {
summary { summary {
background: rgba(138, 180, 248, 0.2); background: var(--accent-blue-alpha-20);
color: var(--text-white); color: var(--text-white);
border-color: rgba(138, 180, 248, 0.4); border-color: var(--accent-blue-alpha-40);
} }
} }
@@ -61,8 +61,8 @@
cursor: pointer; cursor: pointer;
user-select: none; user-select: none;
padding: 0.5rem 1rem; padding: 0.5rem 1rem;
background: rgba(255, 255, 255, 0.05); background: var(--bg-white-05);
border: 1px solid rgba(255, 255, 255, 0.2); border: 1px solid var(--bg-white-20);
border-radius: 6px; border-radius: 6px;
font-weight: bold; font-weight: bold;
text-align: center; text-align: center;
@@ -132,14 +132,14 @@
} }
li a:hover { li a:hover {
background-color: rgba(255, 255, 255, 0.05); background-color: var(--bg-white-05);
color: var(--footer-link-hover-color); color: var(--footer-link-hover-color);
} }
li span.current { li span.current {
color: var(--text-white); color: var(--text-white);
font-weight: bold; font-weight: bold;
background-color: rgba(255, 255, 255, 0.1); background-color: var(--bg-white-10);
} }
} }

View File

@@ -61,7 +61,7 @@ article aside {
margin: 2em; margin: 2em;
padding: 1em 1.5em; padding: 1em 1.5em;
border-left: 4px solid var(--accent-blue); border-left: 4px solid var(--accent-blue);
background-color: rgba(255, 255, 255, 0.03); background-color: var(--bg-white-03);
font-size: 0.9em; font-size: 0.9em;
color: var(--text-light); color: var(--text-light);
font-style: normal; font-style: normal;
@@ -141,7 +141,7 @@ article aside {
display: inline; display: inline;
text-decoration: line-through; text-decoration: line-through;
color: var(--text-red); color: var(--text-red);
background-color: rgba(255, 0, 0, 0.1); background-color: var(--bg-red-01);
padding: 0 0.2em; padding: 0 0.2em;
border-radius: 0.2em; border-radius: 0.2em;
} }
@@ -161,7 +161,7 @@ article aside {
&.spoiler { &.spoiler {
border-left: 4px solid var(--border-muted); border-left: 4px solid var(--border-muted);
background-color: rgba(255, 255, 255, 0.03); background-color: var(--bg-white-03);
summary { summary {
color: var(--text-muted); color: var(--text-muted);
@@ -179,7 +179,7 @@ article aside {
&.update { &.update {
border-left: 4px solid var(--accent-blue); border-left: 4px solid var(--accent-blue);
background-color: rgba(100, 199, 255, 0.1); background-color: var(--bg-accent-blue-01);
summary { summary {
color: var(--accent-blue); color: var(--accent-blue);
@@ -234,10 +234,10 @@ article aside {
margin: 3em auto; margin: 3em auto;
padding: 1rem; padding: 1rem;
border-radius: 1em; border-radius: 1em;
background: radial-gradient(circle at top left, rgba(255, 255, 255, 0.05), rgba(0, 0, 0, 0.7)); background: radial-gradient(circle at top left, var(--bg-white-05), var(--overlay-black-70));
box-shadow: box-shadow:
inset 0 0 0 1px rgba(255, 255, 255, 0.05), inset 0 0 0 1px var(--bg-white-05),
0 0 10px rgba(0, 0, 0, 0.4); 0 0 10px var(--overlay-black-40);
backdrop-filter: blur(4px); backdrop-filter: blur(4px);
max-width: 100%; max-width: 100%;
text-align: center; text-align: center;
@@ -279,8 +279,8 @@ article aside {
margin: 4em auto; margin: 4em auto;
position: relative; position: relative;
background: radial-gradient(ellipse at center -20px, background: radial-gradient(ellipse at center -20px,
rgba(200, 240, 255, 0.18), var(--accent-blue-glow),
transparent 80%); var(--transparent) 80%);
} }
input[type="checkbox"] { input[type="checkbox"] {
@@ -292,7 +292,7 @@ article aside {
/* ⬅ correction ici */ /* ⬅ correction ici */
border: 2px solid var(--border-muted); border: 2px solid var(--border-muted);
border-radius: 0.2em; border-radius: 0.2em;
background-color: transparent; background-color: var(--transparent);
position: relative; position: relative;
cursor: default; cursor: default;
@@ -320,7 +320,7 @@ article aside {
text-decoration: none; text-decoration: none;
font-weight: bold; font-weight: bold;
color: var(--text-green); color: var(--text-green);
background-color: rgba(0, 255, 0, 0.1); background-color: var(--bg-green-01);
padding: 0 0.2em; padding: 0 0.2em;
border-radius: 0.2em; border-radius: 0.2em;
} }
@@ -336,9 +336,9 @@ article aside {
background-color: var(--bg-dark); background-color: var(--bg-dark);
border-radius: 0.3em; border-radius: 0.3em;
box-shadow: box-shadow:
0 0 6px rgba(255, 255, 255, 0.25), 0 0 6px var(--bg-white-25),
0 0 12px rgba(255, 255, 255, 0.12), 0 0 12px var(--bg-white-12),
inset 0 0 1px rgba(255, 255, 255, 0.04); inset 0 0 1px var(--bg-white-04);
white-space: nowrap; white-space: nowrap;
vertical-align: middle; vertical-align: middle;
} }
@@ -443,8 +443,8 @@ article aside {
background-color: var(--bg-dark); background-color: var(--bg-dark);
border-radius: 0.3em; border-radius: 0.3em;
box-shadow: box-shadow:
0 0 1px rgba(0, 255, 0, 0.2), 0 0 1px var(--bg-green-02),
inset 0 0 2px rgba(255, 255, 255, 0.05); inset 0 0 2px var(--bg-white-05);
white-space: pre-wrap; white-space: pre-wrap;
} }
@@ -456,8 +456,8 @@ article aside {
color: var(--accent-green-bright); color: var(--accent-green-bright);
border-radius: 0.5em; border-radius: 0.5em;
box-shadow: box-shadow:
0 0 10px rgba(0, 255, 100, 0.05), 0 0 10px var(--bg-lime-005),
inset 0 0 3px rgba(0, 255, 100, 0.1); inset 0 0 3px var(--bg-lime-01);
font-size: 0.8em; font-size: 0.8em;
max-height: 50vh; max-height: 50vh;
overflow: auto; overflow: auto;
@@ -490,13 +490,13 @@ article aside {
font-size: 0.95em; font-size: 0.95em;
line-height: 1.5; line-height: 1.5;
border: 1px solid var(--border-dark); border: 1px solid var(--border-dark);
background-color: rgba(255, 255, 255, 0.015); background-color: var(--bg-white-015);
/* Suppression des coins arrondis */ /* Suppression des coins arrondis */
border-radius: 0; border-radius: 0;
} }
thead { thead {
background-color: rgba(255, 255, 255, 0.04); background-color: var(--bg-white-04);
color: var(--text-white); color: var(--text-white);
font-weight: bold; font-weight: bold;
} }
@@ -506,7 +506,7 @@ article aside {
border: 1px solid var(--border-dark); border: 1px solid var(--border-dark);
text-align: left; text-align: left;
white-space: nowrap; white-space: nowrap;
background: linear-gradient(to bottom, rgba(255, 255, 255, 0.06), rgba(0, 0, 0, 0.4)); background: linear-gradient(to bottom, var(--bg-white-06), var(--overlay-black-40));
} }
tbody td { tbody td {
@@ -515,23 +515,23 @@ article aside {
vertical-align: top; vertical-align: top;
text-align: left; text-align: left;
color: var(--text-light); color: var(--text-light);
background-color: transparent; background-color: var(--transparent);
transition: background-color 0.2s; transition: background-color 0.2s;
} }
/* Alternance des lignes */ /* Alternance des lignes */
tbody tr:nth-child(even) td { tbody tr:nth-child(even) td {
background-color: rgba(255, 255, 255, 0.015); background-color: var(--bg-white-015);
} }
/* Survol ligne */ /* Survol ligne */
tbody tr:hover td { tbody tr:hover td {
background-color: rgba(100, 199, 255, 0.05); background-color: var(--bg-accent-blue-005);
} }
/* Survol cellule */ /* Survol cellule */
tbody td:hover { tbody td:hover {
background-color: rgba(100, 199, 255, 0.08); background-color: var(--bg-accent-blue-008);
} }
/* Pied du tableau */ /* Pied du tableau */
@@ -539,7 +539,7 @@ article aside {
padding: 0.75em 1em; padding: 0.75em 1em;
font-style: italic; font-style: italic;
color: var(--text-muted); color: var(--text-muted);
background-color: rgba(255, 255, 255, 0.02); background-color: var(--bg-white-02);
border: 1px solid var(--border-dark); border: 1px solid var(--border-dark);
} }
} }

View File

@@ -50,15 +50,62 @@
--scrollbar-thumb: #555; --scrollbar-thumb: #555;
/* Transparency helpers */
--transparent: rgba(0, 0, 0, 0);
/* Neutral white alphas */
--bg-white-00: rgba(255, 255, 255, 0);
--bg-white-015: rgba(255, 255, 255, 0.015); --bg-white-015: rgba(255, 255, 255, 0.015);
--bg-white-02: rgba(255, 255, 255, 0.02); --bg-white-02: rgba(255, 255, 255, 0.02);
--bg-white-03: rgba(255, 255, 255, 0.03); --bg-white-03: rgba(255, 255, 255, 0.03);
--bg-white-04: rgba(255, 255, 255, 0.04); --bg-white-04: rgba(255, 255, 255, 0.04);
--bg-white-05: rgba(255, 255, 255, 0.05);
--bg-white-06: rgba(255, 255, 255, 0.06);
--bg-white-10: rgba(255, 255, 255, 0.1);
--bg-white-12: rgba(255, 255, 255, 0.12);
--bg-white-15: rgba(255, 255, 255, 0.15);
--bg-white-20: rgba(255, 255, 255, 0.2);
--bg-white-25: rgba(255, 255, 255, 0.25);
/* Accent overlays */
--accent-blue-alpha-20: rgba(138, 180, 248, 0.2);
--accent-blue-alpha-40: rgba(138, 180, 248, 0.4);
--accent-blue-glow: rgba(200, 240, 255, 0.18);
/* Utility overlays */
--bg-red-01: rgba(255, 0, 0, 0.1); --bg-red-01: rgba(255, 0, 0, 0.1);
--bg-green-01: rgba(0, 255, 0, 0.1); --bg-green-01: rgba(0, 255, 0, 0.1);
--bg-green-02: rgba(0, 255, 0, 0.2);
--bg-lime-005: rgba(0, 255, 100, 0.05);
--bg-lime-01: rgba(0, 255, 100, 0.1);
/* Accent blues */
--bg-accent-blue-01: rgba(100, 199, 255, 0.1); --bg-accent-blue-01: rgba(100, 199, 255, 0.1);
--bg-accent-blue-005: rgba(100, 199, 255, 0.05); --bg-accent-blue-005: rgba(100, 199, 255, 0.05);
--bg-accent-blue-008: rgba(100, 199, 255, 0.08); --bg-accent-blue-008: rgba(100, 199, 255, 0.08);
/* Neutral black alphas */
--overlay-black-30: rgba(0, 0, 0, 0.3);
--overlay-black-40: rgba(0, 0, 0, 0.4);
--overlay-black-50: rgba(0, 0, 0, 0.5);
--overlay-black-60: rgba(0, 0, 0, 0.6);
--overlay-black-70: rgba(0, 0, 0, 0.7);
--overlay-black-75: rgba(0, 0, 0, 0.75);
--overlay-black-80: rgba(0, 0, 0, 0.8);
/* Charcoal solids */
--surface-panel-strong: rgba(30, 30, 30, 1);
--surface-charcoal-90: rgba(15, 15, 15, 0.9);
--surface-charcoal: rgba(15, 15, 15, 1);
--surface-onyx-95: rgba(1, 1, 1, 0.95);
--surface-onyx: rgba(1, 1, 1, 1);
/* Metallic header accents */
--header-metal-stripe-strong: hsla(0, 0%, 28%, 0.02);
--header-metal-stripe-highlight: hsla(0, 0%, 32%, 0.04);
--header-metal-stripe-soft: hsla(0, 0%, 22%, 0.01);
--header-metal-stripe-soft-highlight: hsla(0, 0%, 26%, 0.03);
--header-metal-gradient-top: hsl(0, 0%, 18%);
--header-metal-gradient-mid: hsl(0, 0%, 22%);
--header-metal-gradient-bottom: hsl(0, 0%, 16%);
} }