LibWeb/CSS: Implement the color-scheme CSS property

This commit is contained in:
Gingeh 2025-01-02 12:59:09 +11:00 committed by Sam Atkins
commit ce5cd012b9
Notes: github-actions[bot] 2025-01-08 11:19:41 +00:00
36 changed files with 618 additions and 370 deletions

View file

@ -4,7 +4,6 @@
@media (prefers-color-scheme: dark) {
:root {
--background: rgb(23, 23, 23);
--separator: dimgray;
--separator-accent: rgb(57, 57, 57);
--tab-controls: rgb(57, 57, 57);
@ -30,7 +29,6 @@
@media (prefers-color-scheme: light) {
:root {
--background: white;
--separator: lightgray;
--separator-accent: white;
--tab-controls: rgb(229, 229, 229);
@ -54,7 +52,7 @@
}
html {
background-color: var(--background);
color-scheme: light dark;
}
body {
@ -186,7 +184,7 @@ body {
left: 0;
right: 0;
background-color: var(--tab-controls);
border-top: 2px solid var(--background);
border-top: 2px solid Canvas;
display: flex;
padding: 0.5em;
}

View file

@ -4,11 +4,8 @@
<meta charset="UTF-8">
<title>New Tab</title>
<style>
/* FIXME: We should be able to remove the HTML style when "color-scheme" is supported */
@media (prefers-color-scheme: dark) {
html {
background-color: rgb(20, 20, 20);
}
html {
color-scheme: light dark;
}
</style>
</head>

View file

@ -4,15 +4,8 @@
<meta charset="UTF-8">
<title>Index of %path%</title>
<style>
/* FIXME: We should be able to remove the HTML style when "color-scheme" is supported */
@media (prefers-color-scheme: dark) {
html {
background-color: rgb(20, 20, 20);
color: rgb(235, 235, 235);
}
a {
color: cornflowerblue;
}
html {
color-scheme: light dark;
}
header {

View file

@ -4,12 +4,8 @@
<meta charset="UTF-8">
<title>Error!</title>
<style>
/* FIXME: We should be able to remove the HTML style when "color-scheme" is supported */
@media (prefers-color-scheme: dark) {
html {
background-color: rgb(20, 20, 20);
color: rgb(235, 235, 235);
}
html {
color-scheme: light dark;
}
h1 {

View file

@ -4,12 +4,8 @@
<meta charset="UTF-8">
<title>About %browser_name%</title>
<style>
/* FIXME: We should be able to remove the HTML style when "color-scheme" is supported */
@media (prefers-color-scheme: dark) {
html {
background-color: rgb(20, 20, 20);
color: rgb(235, 235, 235);
}
html {
color-scheme: light dark;
}
img {
float: left;