This shows you the differences between two versions of the page.
informatique:web:css [2024/10/16 14:08] – created yahiko | informatique:web:css [2024/11/25 10:48] (current) – yahiko | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== CSS ====== | ====== CSS ====== | ||
+ | ===== Thème clair / sombre automatiquement ===== | ||
+ | <code css> | ||
+ | /* Thème sombre par défaut, je suis trop dark tavu */ | ||
+ | :root { | ||
+ | --txt-color: | ||
+ | --bg-color: | ||
+ | --body-font: | ||
+ | } | ||
+ | |||
+ | /* thème clair */ | ||
+ | @media (prefers-color-scheme: | ||
+ | :root { | ||
+ | --bg-color: | ||
+ | --txt-color: | ||
+ | } | ||
+ | } | ||
+ | |||
+ | body { | ||
+ | background-color: | ||
+ | color: var(--txt-color); | ||
+ | font-family: | ||
+ | } | ||
+ | </ | ||
+ | |||
===== Coller un chat en coin de page ===== | ===== Coller un chat en coin de page ===== | ||
Ça fonctionne aussi avec autre chose qu'un chat. | Ça fonctionne aussi avec autre chose qu'un chat. | ||
Line 5: | Line 29: | ||
Voir [[https:// | Voir [[https:// | ||
- | <codedoc | + | <code css> |
body { | body { | ||
background: | background: | ||
} | } | ||
- | </codedoc> | + | </code> |
+ |