This commit is contained in:
Eric Bailey
2024-12-04 11:20:16 -06:00
parent 7b5a5ccbf9
commit b2143cd5b4
4 changed files with 2 additions and 35 deletions
+1 -21
View File
@@ -43,14 +43,8 @@
font-style: italic;
font-display: swap;
}
:root {
--scrollbar-offset: 0px;
--scrollbar-offset-negative: 0px;
}
html {
background-color: white;
scrollbar-gutter: stable;
overflow-y: scroll;
}
@media (prefers-color-scheme: dark) {
html {
@@ -89,23 +83,9 @@
/* We need this style to prevent web dropdowns from shifting the display when opening */
body {
width: 100%;
overflow-y: scroll;
}
</style>
<script>
try {
var windowWidth = window.innerWidth;
var html = document.documentElement;
var htmlWidth = html.getBoundingClientRect().width;
var scrollbarWidth = (windowWidth - htmlWidth) / 2;
var scrollbarOffset = scrollbarWidth / 2;
var isFF = /firefox/i.test(navigator.userAgent)
if (!isFF) {
html.style.setProperty('--scrollbar-offset', `${scrollbarOffset}px`);
html.style.setProperty('--scrollbar-offset-negative', `-${scrollbarOffset}px`);
}
} catch (error) {}
</script>
</head>
<body>