Skip to content

Commit 9cda6f9

Browse files
dvdksnclaude
andcommitted
guides: fix landing load jank (section jump + nav flash)
The section spacing and the nav highlight colors were only applied via Alpine :class bindings, so before Alpine booted the sections rendered with no padding (then jumped down once it applied) and the nav buttons rendered with no color (all looking "selected" until inactive ones dimmed). - Move the grouped section spacing (border-t, py-12) into the static class so first paint matches the initial state. - Give the nav container a default gray text color so buttons inherit the inactive look pre-Alpine. - Preserve the flat-list-while-filtering look with a .guides-flat > section rule toggled on the container only when filtering, so it never affects first paint. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent fe543d7 commit 9cda6f9

2 files changed

Lines changed: 15 additions & 4 deletions

File tree

assets/css/utilities.css

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,15 @@
248248
font-size: calc(var(--text-base) * 0.9);
249249
}
250250

251+
/* Guides landing: collapse section spacing into a flat list while filtering.
252+
Grouped spacing is the static default; this only applies once the page is
253+
being filtered, so it never affects first paint (no layout jank). */
254+
.guides-flat > section {
255+
border-top-width: 0 !important;
256+
padding-top: 0 !important;
257+
padding-bottom: 0 !important;
258+
}
259+
251260
@utility topbar-button {
252261
@apply min-h-10 max-w-40 rounded-md border-1 border-blue-300 bg-(--topnav-button-bg) px-2 text-center font-semibold text-white;
253262
@apply inline-flex items-center justify-center gap-1.5 transition-colors hover:border-blue-300 hover:bg-blue-400;

layouts/guides/landing.html

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@
7474

7575
<div class="flex flex-1 gap-16 xl:gap-24">
7676
<!-- Sticky topic filter -->
77-
<nav class="sticky top-20 hidden w-52 flex-none flex-col self-start xl:flex">
77+
<nav class="sticky top-20 hidden w-52 flex-none flex-col self-start text-gray-500 xl:flex dark:text-gray-400">
7878
<p class="mb-3 text-xs font-semibold tracking-widest text-gray-400 uppercase dark:text-gray-500">
7979
Browse
8080
</p>
@@ -113,7 +113,10 @@
113113
</nav>
114114

115115
<!-- Guide list -->
116-
<div class="min-w-0 flex-1">
116+
<div
117+
class="min-w-0 flex-1"
118+
:class="{ 'guides-flat': filtering() }"
119+
>
117120
<!-- Filtering meta bar -->
118121
<div
119122
x-show="filtering()"
@@ -140,8 +143,7 @@
140143
id="{{ $tag }}"
141144
data-tag="{{ $tag }}"
142145
x-show="sectionVisible($el)"
143-
class="scroll-mt-16"
144-
:class="filtering() ? '' : 'border-t border-gray-200 py-12 first:border-t-0 first:pt-0 dark:border-gray-800'"
146+
class="scroll-mt-16 border-t border-gray-200 py-12 first:border-t-0 first:pt-0 dark:border-gray-800"
145147
>
146148
<div class="mb-6" x-show="!filtering()">
147149
<p class="mb-1 text-xs font-semibold tracking-widest text-gray-400 uppercase dark:text-gray-500">

0 commit comments

Comments
 (0)