This commit is contained in:
parent
6c1a8c8850
commit
a2e65635fb
8 changed files with 98 additions and 111 deletions
|
|
@ -1,66 +1,42 @@
|
|||
@media print {
|
||||
/* Hide header / footer infos. */
|
||||
|
||||
@page {
|
||||
margin: 0;
|
||||
size: auto;
|
||||
|
||||
@top-left {
|
||||
content: none;
|
||||
}
|
||||
@top-right {
|
||||
content: none;
|
||||
}
|
||||
@top-center {
|
||||
content: none;
|
||||
}
|
||||
|
||||
@bottom-left {
|
||||
content: none;
|
||||
}
|
||||
@bottom-right {
|
||||
content: none;
|
||||
}
|
||||
@bottom-center {
|
||||
content: none;
|
||||
}
|
||||
}
|
||||
|
||||
.panel, nav {
|
||||
.panel,
|
||||
nav,
|
||||
.toggle-light {
|
||||
display: none;
|
||||
}
|
||||
|
||||
/* regle du light mode dupliqué*/
|
||||
:root {
|
||||
:root,
|
||||
[data-theme="dark"] {
|
||||
--color-background: #ffffff;
|
||||
--color-primary: #000;
|
||||
|
||||
--color-secondary-rgb: 140, 140, 140;
|
||||
--font-weight-light: 240;
|
||||
}
|
||||
body {
|
||||
padding-top: 4rem;
|
||||
padding-top: 8rem;
|
||||
background-image: none;
|
||||
background-color: var(--color-background) !important;
|
||||
}
|
||||
|
||||
.minimized #inactuel{
|
||||
.minimized #inactuel {
|
||||
transform: none !important;
|
||||
margin: 0 !important;
|
||||
}
|
||||
#logo h1{
|
||||
#logo h1 {
|
||||
display: grid;
|
||||
grid-template-columns: 100%;
|
||||
grid-template-rows: auto;
|
||||
}
|
||||
#logo #actuel, #logo #inactuel{
|
||||
#logo #actuel,
|
||||
#logo #inactuel {
|
||||
grid-column: 1;
|
||||
grid-row: 1;
|
||||
}
|
||||
#logo #actuel {
|
||||
font-weight: 550;
|
||||
color: rgb(254, 250, 254) !important;
|
||||
text-shadow: -1px 0 var(--color-primary), 1px 0 var(--color-primary), 0 -1px var(--color-primary),0 1px var(--color-primary);
|
||||
text-shadow: -1px 0 var(--color-primary), 1px 0 var(--color-primary),
|
||||
0 -1px var(--color-primary), 0 1px var(--color-primary);
|
||||
z-index: 100;
|
||||
}
|
||||
#logo #inactuel {
|
||||
|
|
@ -84,8 +60,12 @@
|
|||
text-decoration: none !important;
|
||||
}
|
||||
|
||||
#chapo {
|
||||
page-break-after: always;
|
||||
}
|
||||
|
||||
article #main-content {
|
||||
width: 60%;
|
||||
width: 70%;
|
||||
margin: auto;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
.theme-toggler {
|
||||
.toggle-light {
|
||||
position: fixed;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
|
|
@ -11,7 +11,7 @@
|
|||
);
|
||||
z-index: 1;
|
||||
}
|
||||
.theme-toggler-icon {
|
||||
.toggle-light-icon {
|
||||
width: 1.2rem;
|
||||
height: 1.2rem;
|
||||
|
||||
|
|
@ -20,14 +20,14 @@
|
|||
mask-size: cover;
|
||||
-webkit-mask-size: cover;
|
||||
|
||||
mask: var(--icon-theme-toggler) no-repeat center;
|
||||
-webkit-mask: var(--icon-theme-toggler) no-repeat center;
|
||||
mask: var(--icon-toggle-light) no-repeat center;
|
||||
-webkit-mask: var(--icon-toggle-light) no-repeat center;
|
||||
}
|
||||
@media screen and (max-width: 640px) {
|
||||
.theme-toggler {
|
||||
.toggle-light {
|
||||
margin-bottom: calc((var(--unit--vertical) / 2) / 2);
|
||||
}
|
||||
.theme-toggler-icon {
|
||||
.toggle-light-icon {
|
||||
width: 1.1rem;
|
||||
height: 1.1rem;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
@charset "UTF-8";
|
||||
html,
|
||||
body,
|
||||
h1,
|
||||
|
|
@ -1155,7 +1154,7 @@ body.full-width #main-content {
|
|||
background-color: transparent;
|
||||
}
|
||||
}
|
||||
.theme-toggler {
|
||||
.toggle-light {
|
||||
position: fixed;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
|
|
@ -1165,61 +1164,40 @@ body.full-width #main-content {
|
|||
z-index: 1;
|
||||
}
|
||||
|
||||
.theme-toggler-icon {
|
||||
.toggle-light-icon {
|
||||
width: 1.2rem;
|
||||
height: 1.2rem;
|
||||
background-color: var(--color-primary);
|
||||
mask-size: cover;
|
||||
-webkit-mask-size: cover;
|
||||
mask: var(--icon-theme-toggler) no-repeat center;
|
||||
-webkit-mask: var(--icon-theme-toggler) no-repeat center;
|
||||
mask: var(--icon-toggle-light) no-repeat center;
|
||||
-webkit-mask: var(--icon-toggle-light) no-repeat center;
|
||||
}
|
||||
|
||||
@media screen and (max-width: 640px) {
|
||||
.theme-toggler {
|
||||
.toggle-light {
|
||||
margin-bottom: calc(var(--unit--vertical) / 2 / 2);
|
||||
}
|
||||
.theme-toggler-icon {
|
||||
.toggle-light-icon {
|
||||
width: 1.1rem;
|
||||
height: 1.1rem;
|
||||
}
|
||||
}
|
||||
@media print {
|
||||
/* Hide header / footer infos. */
|
||||
@page {
|
||||
margin: 0;
|
||||
size: auto;
|
||||
@top-left {
|
||||
content: none;
|
||||
}
|
||||
@top-right {
|
||||
content: none;
|
||||
}
|
||||
@top-center {
|
||||
content: none;
|
||||
}
|
||||
@bottom-left {
|
||||
content: none;
|
||||
}
|
||||
@bottom-right {
|
||||
content: none;
|
||||
}
|
||||
@bottom-center {
|
||||
content: none;
|
||||
}
|
||||
}
|
||||
.panel, nav {
|
||||
.panel,
|
||||
nav,
|
||||
.toggle-light {
|
||||
display: none;
|
||||
}
|
||||
/* regle du light mode dupliqué*/
|
||||
:root {
|
||||
:root,
|
||||
[data-theme=dark] {
|
||||
--color-background: #ffffff;
|
||||
--color-primary: #000;
|
||||
--color-secondary-rgb: 140, 140, 140;
|
||||
--font-weight-light: 240;
|
||||
}
|
||||
body {
|
||||
padding-top: 4rem;
|
||||
padding-top: 8rem;
|
||||
background-image: none;
|
||||
background-color: var(--color-background) !important;
|
||||
}
|
||||
|
|
@ -1232,7 +1210,8 @@ body.full-width #main-content {
|
|||
grid-template-columns: 100%;
|
||||
grid-template-rows: auto;
|
||||
}
|
||||
#logo #actuel, #logo #inactuel {
|
||||
#logo #actuel,
|
||||
#logo #inactuel {
|
||||
grid-column: 1;
|
||||
grid-row: 1;
|
||||
}
|
||||
|
|
@ -1258,8 +1237,11 @@ body.full-width #main-content {
|
|||
a {
|
||||
text-decoration: none !important;
|
||||
}
|
||||
#chapo {
|
||||
page-break-after: always;
|
||||
}
|
||||
article #main-content {
|
||||
width: 60%;
|
||||
width: 70%;
|
||||
margin: auto;
|
||||
}
|
||||
}
|
||||
|
|
@ -1332,19 +1314,19 @@ body.full-width #main-content {
|
|||
--curve-sine: cubic-bezier(0.445, 0.05, 0.55, 0.95);
|
||||
}
|
||||
|
||||
[data-theme=dark] {
|
||||
--color-background: #000;
|
||||
--color-primary: #ffffff;
|
||||
--font-weight-light: 200;
|
||||
@media screen {
|
||||
[data-theme=dark] {
|
||||
--color-background: #000;
|
||||
--color-primary: #ffffff;
|
||||
--font-weight-light: 200;
|
||||
}
|
||||
[data-theme=light] {
|
||||
--color-background: #ffffff;
|
||||
--color-primary: #000;
|
||||
--color-secondary-rgb: 140, 140, 140;
|
||||
--font-weight-light: 240;
|
||||
}
|
||||
}
|
||||
|
||||
[data-theme=light] {
|
||||
--color-background: #ffffff;
|
||||
--color-primary: #000;
|
||||
--color-secondary-rgb: 140, 140, 140;
|
||||
--font-weight-light: 240;
|
||||
}
|
||||
|
||||
@media screen and (min-width: 640px) {
|
||||
:root {
|
||||
--unit--horizontal: 2.5vw;
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
|
|
@ -47,18 +47,20 @@
|
|||
--curve-sine: cubic-bezier(0.445, 0.05, 0.55, 0.95);
|
||||
}
|
||||
|
||||
[data-theme="dark"] {
|
||||
--color-background: #000;
|
||||
--color-primary: #ffffff;
|
||||
@media screen {
|
||||
[data-theme="dark"] {
|
||||
--color-background: #000;
|
||||
--color-primary: #ffffff;
|
||||
|
||||
--font-weight-light: 200;
|
||||
}
|
||||
[data-theme="light"] {
|
||||
--color-background: #ffffff;
|
||||
--color-primary: #000;
|
||||
--font-weight-light: 200;
|
||||
}
|
||||
[data-theme="light"] {
|
||||
--color-background: #ffffff;
|
||||
--color-primary: #000;
|
||||
|
||||
--color-secondary-rgb: 140, 140, 140;
|
||||
--font-weight-light: 240;
|
||||
--color-secondary-rgb: 140, 140, 140;
|
||||
--font-weight-light: 240;
|
||||
}
|
||||
}
|
||||
|
||||
@media screen and (min-width: 640px) {
|
||||
|
|
|
|||
|
|
@ -10,7 +10,9 @@
|
|||
|
||||
function init() {
|
||||
const storedPreference = localStorage.getItem("theme");
|
||||
const systemPrefersDark = window.matchMedia("(prefers-color-scheme: dark)").matches;
|
||||
const systemPrefersDark = window.matchMedia(
|
||||
"(prefers-color-scheme: dark)"
|
||||
).matches;
|
||||
const theme = storedPreference || (systemPrefersDark ? "dark" : "light");
|
||||
|
||||
// const theme = "dark";
|
||||
|
|
@ -21,9 +23,9 @@
|
|||
init();
|
||||
|
||||
document.addEventListener("DOMContentLoaded", function () {
|
||||
const togglers = document.querySelectorAll(".theme-toggler");
|
||||
const togglers = document.querySelectorAll(".toggle-light");
|
||||
togglers.forEach((toggler) => {
|
||||
toggler.addEventListener("click", toggleDarkMode);
|
||||
});
|
||||
});
|
||||
})();
|
||||
})();
|
||||
|
|
|
|||
|
|
@ -1,3 +1,23 @@
|
|||
const root = document.documentElement;
|
||||
|
||||
function initTheme() {
|
||||
const storedPreference = localStorage.getItem("theme");
|
||||
const systemPrefersDark = window.matchMedia(
|
||||
"(prefers-color-scheme: dark)"
|
||||
).matches;
|
||||
const theme = storedPreference || (systemPrefersDark ? "dark" : "light");
|
||||
root.setAttribute("data-theme", theme);
|
||||
}
|
||||
|
||||
function toggleDarkMode() {
|
||||
const currentTheme = root.getAttribute("data-theme");
|
||||
const newTheme = currentTheme === "dark" ? "light" : "dark";
|
||||
root.setAttribute("data-theme", newTheme);
|
||||
localStorage.setItem("theme", newTheme);
|
||||
}
|
||||
|
||||
initTheme();
|
||||
|
||||
const verticalUnit = getUnit("--unit--vertical");
|
||||
|
||||
function getUnit(id) {
|
||||
|
|
@ -173,6 +193,10 @@ document.addEventListener("DOMContentLoaded", () => {
|
|||
|
||||
fixFootNotes();
|
||||
|
||||
document.querySelectorAll(".toggle-light").forEach((toggler) => {
|
||||
toggler.addEventListener("click", toggleDarkMode);
|
||||
});
|
||||
|
||||
window.addEventListener("keyup", (event) => {
|
||||
if (event.key === "Escape") {
|
||||
closeAllPanels();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue