style: fix horizontal scrollbar for some screen sizes (#3177)

On the Fresh docs, I get a vertical scrollbar for a small range of
viewport size of the browser. This is annoying me, since I get it when I
place two windows next to each other on a 21:9 screen.

The issue seems to stem from a button using `p-1 -m-1`. But the negative
margin is there to address the increased space due to making the button
easier to click (most likely for touch/mobile). But this makes the
button overflow when there is no right-margin (`2xl:mr-0`).

<img width="1637" height="661" alt="image"
src="https://github.com/user-attachments/assets/48773cf5-316d-41f3-99e0-54f49b1f2cc9"
/>

## Solution

The simplest and easiest fix here is just to increase the margin to
cover for this case. `2xl:mr-1` seems to do the trick. But it might be a
good idea to have a little more gap towards the edge of the screen, e.g.
`2xl-mr-2`.
This commit is contained in:
Christian Svensson
2025-08-05 23:49:13 +02:00
committed by GitHub
parent d108b2c182
commit 349372ad82
3 changed files with 2 additions and 6 deletions
+1 -1
View File
@@ -22,7 +22,7 @@ export default function NavigationBar(
const isDocs = props.active == "/docs"; const isDocs = props.active == "/docs";
return ( return (
<nav class={"flex " + (props.class ?? "")} f-client-nav={false}> <nav class={"flex " + (props.class ?? "")} f-client-nav={false}>
<ul class="flex items-center gap-x-2 sm:gap-4 mx-4 my-2 sm:my-6 flex-wrap lg:mx-8 2xl:mr-0"> <ul class="flex items-center gap-x-2 sm:gap-4 mx-4 my-2 sm:my-6 flex-wrap lg:mx-8 2xl:mr-1">
{items.map((item) => ( {items.map((item) => (
<li key={item.name}> <li key={item.name}>
<a <a
+1 -1
View File
@@ -16,7 +16,7 @@ export default function ThemeToggle() {
<button <button
type="button" type="button"
onClick={toggleTheme} onClick={toggleTheme}
class="dark-mode-toggle button p-1 -m-1" class="cursor-pointer p-1 -m-1"
aria-label="Toggle Theme" aria-label="Toggle Theme"
> >
{theme.value === "light" {theme.value === "light"
-4
View File
@@ -79,10 +79,6 @@ hr {
border-color: hsl(from var(--color-foreground-secondary) h s l / 0.1); border-color: hsl(from var(--color-foreground-secondary) h s l / 0.1);
} }
.dark-mode-toggle-button img {
fill: var(--color-foreground-primary);
}
::selection { ::selection {
background-color: #b1d5ff; background-color: #b1d5ff;
} }