transitioned demos 1 and 2 to picocss for looks
This commit is contained in:
parent
e012cfa2f6
commit
f978f92056
2 changed files with 40 additions and 36 deletions
|
@ -6,42 +6,44 @@
|
||||||
|
|
||||||
<title>Demo of the simplest implementation of a light/dark theme toggle</title>
|
<title>Demo of the simplest implementation of a light/dark theme toggle</title>
|
||||||
|
|
||||||
|
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@picocss/pico@2/css/pico.min.css">
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
<style>
|
<style>
|
||||||
@media (prefers-color-scheme: light) {
|
@media (prefers-color-scheme: light) {
|
||||||
body {
|
:root {
|
||||||
color: black;
|
--pico-color: black;
|
||||||
background: white;
|
--pico-background-color: white;
|
||||||
--button-bg: #888;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
body.toggled {
|
:root:has(body.toggled) {
|
||||||
color: white;
|
--pico-color: white;
|
||||||
background: black;
|
--pico-background-color: black;
|
||||||
--button-bg: #888;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@media (prefers-color-scheme: dark) {
|
@media (prefers-color-scheme: dark) {
|
||||||
body {
|
:root {
|
||||||
color: white;
|
--pico-color: white;
|
||||||
background: black;
|
--pico-background-color: black;
|
||||||
--button-bg: #888;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
body.toggled {
|
:root:has(body.toggled) {
|
||||||
color: black;
|
--pico-color: black;
|
||||||
background: white;
|
--pico-background-color: white;
|
||||||
--button-bg: #888;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
button {
|
button {
|
||||||
color: inherit;
|
transition-duration: 0.05s;
|
||||||
background: var(--button-bg);
|
transition-property: outline;
|
||||||
|
transition-delay: 0s;
|
||||||
|
}
|
||||||
|
|
||||||
|
button:active {
|
||||||
|
outline: turquoise 5px solid;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
<script async>
|
<script async>
|
||||||
|
|
|
@ -6,42 +6,44 @@
|
||||||
|
|
||||||
<title>Demo of the simplest implementation of a light/dark theme toggle</title>
|
<title>Demo of the simplest implementation of a light/dark theme toggle</title>
|
||||||
|
|
||||||
|
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@picocss/pico@2/css/pico.min.css">
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
<style>
|
<style>
|
||||||
@media (prefers-color-scheme: light) {
|
@media (prefers-color-scheme: light) {
|
||||||
body {
|
:root {
|
||||||
color: black;
|
--pico-color: black;
|
||||||
background: white;
|
--pico-background-color: white;
|
||||||
--button-bg: #888;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
body.toggled {
|
:root:has(body.toggled) {
|
||||||
color: white;
|
--pico-color: white;
|
||||||
background: black;
|
--pico-background-color: black;
|
||||||
--button-bg: #888;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@media (prefers-color-scheme: dark) {
|
@media (prefers-color-scheme: dark) {
|
||||||
body {
|
:root {
|
||||||
color: white;
|
--pico-color: white;
|
||||||
background: black;
|
--pico-background-color: black;
|
||||||
--button-bg: #888;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
body.toggled {
|
:root:has(body.toggled) {
|
||||||
color: black;
|
--pico-color: black;
|
||||||
background: white;
|
--pico-background-color: white;
|
||||||
--button-bg: #888;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
button {
|
button {
|
||||||
color: inherit;
|
transition-duration: 0.05s;
|
||||||
background: var(--button-bg);
|
transition-property: outline;
|
||||||
|
transition-delay: 0s;
|
||||||
|
}
|
||||||
|
|
||||||
|
button:active {
|
||||||
|
outline: turquoise 5px solid;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
<script>
|
<script>
|
||||||
|
|
Loading…
Reference in a new issue