add darktheme and names
This commit is contained in:
1 parent
78582bf51e
commit
772c9dcba4
11 files changed
+436
-66
No files matched your search
@@ -4,6 +4,21 @@
|
||||
la source explicitement : les vues Leptos vivent dans le dossier `src`. */
|
||||
@source "../src";
|
||||
|
||||
/* Variante `dark:` à trois états, pilotée par l'attribut `data-theme` de <html> :
|
||||
- data-theme="dark" : sombre forcé ;
|
||||
- data-theme="light" : clair forcé ;
|
||||
- sans attribut : suit le réglage du système (prefers-color-scheme). */
|
||||
@custom-variant dark {
|
||||
&:where([data-theme="dark"], [data-theme="dark"] *) {
|
||||
@slot;
|
||||
}
|
||||
@media (prefers-color-scheme: dark) {
|
||||
&:where(:not([data-theme="light"], [data-theme="light"] *)) {
|
||||
@slot;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@theme {
|
||||
--color-accent: #d6336c;
|
||||
--color-accent-hover: #b82a5c;
|
||||
@@ -14,4 +29,10 @@
|
||||
:root {
|
||||
color-scheme: light dark;
|
||||
}
|
||||
:root[data-theme="light"] {
|
||||
color-scheme: light;
|
||||
}
|
||||
:root[data-theme="dark"] {
|
||||
color-scheme: dark;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user