Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
lukewarlow committed Jun 24, 2023
1 parent 7b682ab commit 520314b
Show file tree
Hide file tree
Showing 4 changed files with 137 additions and 0 deletions.
34 changes: 34 additions & 0 deletions css/css-scrollbars/scrollbar-color-scheme-dynamic-ref.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<!doctype html>
<style>
:root {
color-scheme: dark;
}
body {
display: flex;
flex-wrap: wrap;
width: 200vw;
height: 200vh;
}

.container {
scrollbar-gutter: stable;
flex: 0 0;
overflow: auto;
height: 200px;
min-width: 200px;
margin: 1px;
padding: 0px;
border: none;
background: deepskyblue;
}

.content {
height: 300px;
width: 300px;
background: red;
}
</style>

<div id="one" class="container">
<div class="content"></div>
</div>
23 changes: 23 additions & 0 deletions css/css-scrollbars/scrollbar-color-scheme-dynamic-scroll-ref.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<!doctype html>
<style>
:root {
color-scheme: dark;
}
body {
display: flex;
flex-wrap: wrap;
overflow: scroll;
}
.container {
scrollbar-gutter: stable;
overflow: scroll;
flex: 0 0;
height: 200px;
min-width: 200px;
margin: 1px;
padding: 0px;
border: none;
background: deepskyblue;
}
</style>
<div class="container"></div>
35 changes: 35 additions & 0 deletions css/css-scrollbars/scrollbar-color-scheme-dynamic-scroll.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<!doctype html>
<html class="reftest-wait">
<title>Dynamically set color-scheme and ensure scrollbars update when overflow scroll</title>
<link rel="author" title="Luke Warlow" href="mailto:luke@warlow.dev" />
<link rel="match" href="scrollbar-color-scheme-dynamic-scroll-ref.html" />
<script src="/common/reftest-wait.js"></script>
<style>
:root {
color-scheme: light;
}
body {
display: flex;
flex-wrap: wrap;
overflow: scroll;
}
.container {
scrollbar-gutter: stable;
overflow: scroll;
flex: 0 0;
height: 200px;
min-width: 200px;
margin: 1px;
padding: 0px;
border: none;
background: deepskyblue;
}
</style>
<div class="container"></div>
<script>
requestAnimationFrame(() => requestAnimationFrame(() => {
document.documentElement.style.colorScheme = 'dark';

takeScreenshot();
}));
</script>
45 changes: 45 additions & 0 deletions css/css-scrollbars/scrollbar-color-scheme-dynamic.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
<!doctype html>
<html class="reftest-wait">
<title>Dynamically set color-scheme and ensure scrollbars update</title>
<link rel="author" title="Luke Warlow" href="mailto:luke@warlow.dev" />
<link rel="match" href="scrollbar-color-scheme-dynamic-ref.html" />
<script src="/common/reftest-wait.js"></script>
<style>
:root {
color-scheme: light;
}
body {
display: flex;
flex-wrap: wrap;
width: 200vw;
height: 200vh;
}

.container {
scrollbar-gutter: stable;
overflow: auto;
flex: 0 0;
height: 200px;
min-width: 200px;
margin: 1px;
padding: 0px;
border: none;
background: deepskyblue;
}

.content {
height: 300px;
width: 300px;
background: red;
}
</style>
<div id="one" class="container">
<div class="content"></div>
</div>
<script>
requestAnimationFrame(() => requestAnimationFrame(() => {
document.documentElement.style.colorScheme = 'dark';

takeScreenshot();
}));
</script>

0 comments on commit 520314b

Please sign in to comment.