feat: support des couleurs d'accents

Fixes #4
This commit is contained in:
Kazhnuz 2024-09-22 18:48:26 +02:00
parent 8ff3ea2933
commit 84fd7b6793

View file

@ -1,6 +1,20 @@
:root { :root {
--font-family: Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', Cantarell, Roboto, Oxygen, Ubuntu, 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif; --font-family: Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', Cantarell, Roboto, Oxygen, Ubuntu, 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
--font-family-monospace: Consolas, Menlo, Monaco, Andale Mono WT, Andale Mono, Lucida Console, Lucida Sans Typewriter, DejaVu Sans Mono, Bitstream Vera Sans Mono, Liberation Mono, Nimbus Mono L, Courier New, Courier, monospace; --font-family-monospace: Consolas, Menlo, Monaco, Andale Mono WT, Andale Mono, Lucida Console, Lucida Sans Typewriter, DejaVu Sans Mono, Bitstream Vera Sans Mono, Liberation Mono, Nimbus Mono L, Courier New, Courier, monospace;
--text-color: #212529;
--border-color: rgba(0,0,0,0.2);
--background-color: #f8f9fa;
--well-color: #e9ecef;
--accent-color: #1864ab;
}
@media (prefers-color-scheme: dark) {
:root {
--text-color: #f1f3f5;
--background-color: #212529;
--well-color: #343a40;
--accent-color: #d0ebff;
}
} }
// Change these two variables for styling // Change these two variables for styling
@ -20,21 +34,19 @@ html {
font-family: var(--font-family); font-family: var(--font-family);
text-align: left; text-align: left;
font-size: 17px; font-size: 17px;
background-color: var(--background-color);
accent-color: var(--accent-color);
} }
body { body {
line-height: $lineheight; line-height: $lineheight;
color: #444; color: var(--text-color);
font-weight: 400; font-weight: 400;
max-width: 800px; max-width: 800px;
padding:1rem; padding:1rem;
margin: auto; margin: auto;
} }
.night-mode {
color:#BBB;
}
strong { strong {
font-weight: 600; font-weight: 600;
} }
@ -44,7 +56,7 @@ em {
} }
a { a {
color:#2484c1; color: var(--accent-color);
text-decoration:none; text-decoration:none;
} }
@ -85,8 +97,7 @@ sub {
} }
::selection { background: #2484c1; color: #fff; } ::selection, ::-moz-selection { background: var(--accent-color); color: var(--background-color); }
::-moz-selection { background: #2484c1; color: #fff; }
/* ------------------ TITLES ------------------- */ /* ------------------ TITLES ------------------- */
@ -135,7 +146,7 @@ hr {
border-left: 0px; border-left: 0px;
border-right: 0px; border-right: 0px;
border-bottom: 1px; border-bottom: 1px;
border-color: rgba(1,1,1,0.15); border-color: var(--border-color);
border-style: solid; border-style: solid;
padding:0; padding:0;
margin:0; margin:0;
@ -159,24 +170,21 @@ hr {
blockquote { blockquote {
@include well(); @include well();
border-color: rgba(1, 1, 1, 0.15); border-color: var(--accent-color);
background-color:var(--well-color);
.night-mode & {
border-color: rgba(255, 255, 255, 0.15)
}
} }
pre { pre {
@include well(); @include well();
border-color: rgba(1,1,1,0.20); border-color: var(--accent-color);
background-color:#EEE; background-color:var(--well-color);
.night-mode & {
background-color:#222;
border-color:rgba(255,255,255,0.20);
}
} }
code {
background-color:var(--well-color);
padding: 5px;
border-radius: 3px;
}
/* ------------------ SPECIAL STYLING ------------------- */ /* ------------------ SPECIAL STYLING ------------------- */
@ -189,10 +197,6 @@ mark {
color: inherit; color: inherit;
} }
.night-mode mark {
background-color:rgba(128,128,0,0.66);
}
/* ------------------ SPECIAL STYLING ------------------- */ /* ------------------ SPECIAL STYLING ------------------- */
.time { .time {