summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorRasmus Andersson <rasmus@notion.se>2021-04-01 00:34:11 +0300
committerRasmus Andersson <rasmus@notion.se>2021-04-01 00:34:11 +0300
commitb80228e35d9c07c4c4e6b2b49aa556c204f986e3 (patch)
tree484ce06387cb8538bd9bfae246f544d01848d612 /docs
parent9b8f3f1b5ae495f0da18c17012d0689edab7f828 (diff)
downloadinter-b80228e35d9c07c4c4e6b2b49aa556c204f986e3.tar.xz
web: lab: adds draw-sample-background option
Diffstat (limited to 'docs')
-rw-r--r--docs/lab/index.html11
-rw-r--r--docs/lab/lab.css8
2 files changed, 15 insertions, 4 deletions
diff --git a/docs/lab/index.html b/docs/lab/index.html
index 8a9ad5c7d..f98b9d531 100644
--- a/docs/lab/index.html
+++ b/docs/lab/index.html
@@ -49,6 +49,10 @@ if (window.matchMedia('(prefers-color-scheme: dark)').matches) {
<b>☀</b>
<input type="checkbox" name="invert-colors">
</label>
+ <label title="Draw background behind samples">
+ <b>■</b>
+ <input type="checkbox" name="draw-sample-bg">
+ </label>
</div>
<label class="label-and-value">
@@ -1095,12 +1099,15 @@ function main() {
}, {passive:false,capture:true})
vars.bind("invert-colors", (e, on) => {
- if (defaultColorSceme == "dark") {
+ if (defaultColorSceme == "dark")
on = !on
- }
document.documentElement.classList.toggle('color-scheme-dark', on)
})
+ vars.bind("draw-sample-bg", (e, on) => {
+ document.documentElement.classList.toggle('draw-sample-background', on)
+ })
+
let spaaSelect = vars.bind('antialias', (e, v) => {
switch (v) {
case 'subpixel': {
diff --git a/docs/lab/lab.css b/docs/lab/lab.css
index a4f603b11..bf1ff3a0b 100644
--- a/docs/lab/lab.css
+++ b/docs/lab/lab.css
@@ -653,9 +653,10 @@ body.italic samples {
}
sample {
flex: 1 1 50%;
- margin: 0;
+ /*margin: 0;*/
/*white-space: pre;*/
- padding: 2rem;
+ margin: calc(0.5em + 1rem);
+ padding: 0;
min-width:100px;
/*max-width:450px;*/
white-space: pre-wrap;
@@ -663,6 +664,9 @@ body.italic samples {
overflow-wrap: break-word;
color: var(--fgColor);
}
+ :root.draw-sample-background sample {
+ background: var(--surface2-color-bg-active);
+ }
/*body.secondarySampleDisabled sample { flex-basis: auto; }*/
sample p {
white-space: pre-wrap;