Synchronize --wide, --narrow with Etiquette.

This commit is contained in:
voussoir 2020-09-19 10:42:31 -07:00
parent 34aafedf46
commit 69c1dd92e9
2 changed files with 31 additions and 0 deletions

View file

@ -12,6 +12,22 @@
--color_highlight: rgba(255, 255, 255, 0.5); --color_highlight: rgba(255, 255, 255, 0.5);
} }
@media screen and (min-width: 800px)
{
:root
{
--wide: 1;
}
}
@media screen and (max-width: 800px)
{
:root
{
--narrow: 1;
}
}
.hidden .hidden
{ {
display: none !important; display: none !important;
@ -104,6 +120,9 @@ pre
grid-auto-rows: min-content; grid-auto-rows: min-content;
grid-gap: 8px; grid-gap: 8px;
/*
8px all around except the top, where the header already has a margin.
*/
margin: 8px; margin: 8px;
margin-top: 0; margin-top: 0;
} }

View file

@ -453,6 +453,18 @@ function init_all_tabbed_container()
} }
} }
common.is_narrow_mode =
function is_narrow_mode()
{
return getComputedStyle(document.documentElement).getPropertyValue("--narrow").trim() === "1";
}
common.is_wide_mode =
function is_wide_mode()
{
return getComputedStyle(document.documentElement).getPropertyValue("--wide").trim() === "1";
}
common.tabbed_container_switcher = common.tabbed_container_switcher =
function tabbed_container_switcher(event) function tabbed_container_switcher(event)
{ {