Skip to content

Worktrunk is a CLI for Git worktree management, designed for parallel AI agent workflows

refactor(docs): CSS simplification and semantic consistency fixes (#866)

Maximilian Roosb969a1aed77f
diff --git a/docs/sass/custom.scss b/docs/sass/custom.scss
index 8b8415f2d..729436d58 100644
--- a/docs/sass/custom.scss
+++ b/docs/sass/custom.scss
@@ -43,6 +43,28 @@ a {
// Typography
// ============================================================================
+// Shared heading underline effect (H1/H2)
+// Turns gold on hover, otherwise subtle craft brown
+%heading-underline {
+ &::after {
+ content: "";
+ position: absolute;
+ left: 0;
+ bottom: -0.3rem;
+ width: 45%;
+ height: 2px;
+ background: var(--wt-color-craft-brown);
+ opacity: 0.5;
+ border-radius: 1px;
+ transition: background 150ms ease-out, opacity 150ms ease-out;
+ }
+
+ &:hover::after {
+ background: var(--wt-color-accent);
+ opacity: 1;
+ }
+}
+
// Headings
h1, h2, h3, h4, h5, h6 {
font-family: var(--wt-font-head);
@@ -60,25 +82,8 @@ h1 {
position: relative;
width: fit-content; // Block-level but sized to content (for underline effect)
- // Same underline treatment as h2
> a {
- &::after {
- content: "";
- position: absolute;
- left: 0;
- bottom: -0.3rem;
- width: 45%;
- height: 2px;
- background: var(--wt-color-craft-brown);
- opacity: 0.5;
- border-radius: 1px;
- transition: background 150ms ease-out, opacity 150ms ease-out;
- }
-
- &:hover::after {
- background: var(--wt-color-accent);
- opacity: 1;
- }
+ @extend %heading-underline;
}
}
@@ -86,38 +91,20 @@ h2 {
font-size: 1.4rem;
font-weight: 600;
letter-spacing: -0.02em;
- margin-top: 1.5rem;
+ margin-top: 1.6rem;
margin-bottom: 0.4rem;
position: relative;
display: inline-block;
- // Anchor inside h2 gets the underline (aligns with text)
> a {
- // Hand-drawn underline - turns gold on hover
- &::after {
- content: "";
- position: absolute;
- left: 0;
- bottom: -0.3rem;
- width: 45%;
- height: 2px;
- background: var(--wt-color-craft-brown);
- opacity: 0.5;
- border-radius: 1px;
- transition: background 150ms ease-out, opacity 150ms ease-out;
- }
-
- &:hover::after {
- background: var(--wt-color-accent);
- opacity: 1;
- }
+ @extend %heading-underline;
}
}
h3 {
font-size: 1.15rem;
font-weight: 550;
- margin-top: 1.25rem;
+ margin-top: 1.2rem;
margin-bottom: 0.3rem;
color: var(--wt-color-text-muted);
}
@@ -125,6 +112,8 @@ h3 {
h4 {
font-size: 1rem;
font-weight: 550;
+ margin-top: 1rem;
+ margin-bottom: 0.25rem;
}
// Heading anchor links - entire heading is clickable
@@ -247,7 +236,7 @@ nav {
font-weight: 500;
color: var(--wt-color-text-muted);
padding: 0.2rem 0.4rem;
- border-radius: 999px;
+ border-radius: var(--wt-radius-pill);
transition: color 150ms, background 150ms;
&:hover {
@@ -287,7 +276,7 @@ nav {
color: var(--wt-color-text);
background: var(--wt-color-bg);
border: 1px solid var(--wt-color-border-subtle);
- border-radius: 0.5rem;
+ border-radius: var(--wt-radius-md);
transition: width 150ms, border-color 150ms;
&::placeholder {
@@ -305,7 +294,7 @@ nav {
overflow-y: auto;
background: var(--wt-color-bg-elevated);
border: 1px solid var(--wt-color-border-subtle);
- border-radius: 0.5rem;
+ border-radius: var(--wt-radius-md);
box-shadow: 0 8px 30px var(--wt-shadow-medium);
z-index: 1000;
}
@@ -366,7 +355,7 @@ main {
overflow-x: auto;
padding: 1.5rem 30px;
background-color: var(--wt-color-bg-elevated);
- border-radius: 12px;
+ border-radius: var(--wt-radius-lg);
border: 1px solid var(--wt-color-border-subtle);
box-shadow: 0 1px 3px var(--wt-shadow-soft);
// Account for sticky header when scrolling to page anchor (e.g., /#worktrunk)
@@ -391,7 +380,7 @@ main {
box-sizing: border-box;
border: 1px solid var(--wt-color-code-border);
border-left: 3px solid var(--wt-color-accent);
- border-radius: 0 0.5rem 0.5rem 0;
+ border-radius: 0 var(--wt-radius-md) var(--wt-radius-md) 0;
box-shadow: 0 2px 8px var(--wt-shadow-soft), 0 1px 2px var(--wt-shadow-medium);
}
@@ -467,7 +456,7 @@ main {
background-color: var(--wt-color-code-bg);
border: 1px solid var(--wt-color-code-border);
border-left: 3px solid var(--wt-color-accent);
- border-radius: 0 0.5rem 0.5rem 0;
+ border-radius: 0 var(--wt-radius-md) var(--wt-radius-md) 0;
padding: 0.875rem 1rem;
overflow-x: auto;
margin: 1.25rem 0;
@@ -513,7 +502,7 @@ main {
padding: 0.4rem;
background: var(--wt-color-bg-soft);
border: 1px solid var(--wt-color-border-subtle);
- border-radius: 0.3rem;
+ border-radius: var(--wt-radius-sm);
cursor: pointer;
color: var(--wt-color-text-muted);
opacity: 0;
@@ -580,7 +569,7 @@ main {
// ============================================================================
.content blockquote {
- border-radius: 0.5rem;
+ border-radius: var(--wt-radius-md);
padding: 0.75rem 1rem;
border: 1px solid var(--wt-color-border-subtle);
border-left: 3px solid var(--wt-color-accent);
@@ -608,7 +597,7 @@ main {
border-collapse: separate;
border-spacing: 0;
margin: 1rem 0;
- border-radius: 0.5rem;
+ border-radius: var(--wt-radius-md);
border: 1px solid var(--wt-color-border-subtle);
th, td {
@@ -678,7 +667,7 @@ main {
position: sticky;
top: calc(var(--wt-header-height) + var(--wt-main-padding-top));
box-sizing: border-box;
- border-radius: 0.5rem;
+ border-radius: var(--wt-radius-md);
background-color: var(--wt-color-bg-elevated);
border: 1px solid var(--wt-color-border-subtle);
border-top: 3px solid var(--wt-color-accent);
@@ -710,7 +699,7 @@ main {
a {
display: block;
padding: 0.55rem 0.5rem;
- border-radius: 0.25rem;
+ border-radius: var(--wt-radius-sm);
font-size: 0.8rem;
color: var(--wt-color-text-muted);
transition: color 150ms, background 150ms;
@@ -730,14 +719,14 @@ main {
}
.toc-item-child {
- padding: 0 0.45rem 0.15rem 1rem;
+ padding: 0;
margin: 0 0.4rem;
a {
font-size: 0.75rem;
color: var(--wt-color-text-soft);
- padding: 0.1rem 0.35rem;
- border-radius: 0.2rem;
+ padding: 0.2rem 0.8rem 0.2rem 1.35rem;
+ border-radius: var(--wt-radius-sm);
display: block;
transition: color 150ms, background 150ms;
@@ -748,19 +737,19 @@ main {
}
&.nested {
- padding-left: 1.6rem;
-
a {
font-size: 0.7rem;
+ padding-left: 1.95rem;
}
}
// H1 entries in TOC - section markers
- // Same alignment as H2s, distinguished by weight and spacing
+ // Distinguished by size, weight, and spacing from H2 items
&.toc-h1 {
margin-top: 0.5rem;
a {
+ font-size: 0.8rem;
font-weight: 600;
color: var(--wt-color-text-muted);
@@ -792,7 +781,7 @@ main {
color: var(--wt-color-accent);
font-weight: 500;
padding: 0.5rem 1rem;
- border-radius: 0.5rem;
+ border-radius: var(--wt-radius-md);
transition: color 150ms, background 150ms;
&:hover {
@@ -949,15 +938,21 @@ footer {
background: var(--wt-color-accent);
color: white;
padding: 0.6rem 1.5rem;
- border-radius: 999px;
+ border-radius: var(--wt-radius-pill);
font-weight: 600;
font-size: 1rem;
border: none;
cursor: pointer;
transition: background 150ms, box-shadow 150ms;
+ box-shadow: 0 2px 4px var(--wt-shadow-accent);
&:hover {
background: var(--wt-color-accent-strong);
+ box-shadow: 0 4px 12px var(--wt-shadow-accent-strong);
+ }
+
+ &:active {
+ box-shadow: 0 1px 2px var(--wt-shadow-accent);
}
}
@@ -1110,7 +1105,7 @@ figcaption {
font-size: 0.95rem;
font-weight: 500;
color: var(--wt-color-text);
- border-radius: 0.375rem;
+ border-radius: var(--wt-radius-sm);
transition: background 150ms, color 150ms;
&:hover {
@@ -1147,7 +1142,7 @@ figcaption {
padding: 0.5rem 0.75rem;
font-size: 0.85rem;
color: var(--wt-color-text-muted);
- border-radius: 0.25rem;
+ border-radius: var(--wt-radius-sm);
transition: background 150ms, color 150ms;
&:hover {
@@ -1193,7 +1188,7 @@ body.mobile-menu-open {
.content {
padding: 1rem 16px;
- border-radius: 12px;
+ border-radius: var(--wt-radius-lg);
}
h1, .heading-text {
@@ -1303,18 +1298,7 @@ input:focus-visible {
}
}
-// Button - enhanced hover
-.button {
- box-shadow: 0 2px 4px var(--wt-shadow-accent);
-
- &:hover {
- box-shadow: 0 4px 12px var(--wt-shadow-accent-strong);
- }
-
- &:active {
- box-shadow: 0 1px 2px var(--wt-shadow-accent);
- }
-}
+// .button shadows defined in Hero Section
// Custom scrollbar (webkit browsers)
::-webkit-scrollbar {
@@ -1328,7 +1312,7 @@ input:focus-visible {
::-webkit-scrollbar-thumb {
background: var(--wt-color-border-subtle);
- border-radius: 4px;
+ border-radius: var(--wt-radius-sm);
&:hover {
background: var(--wt-color-text-soft);
@@ -1368,10 +1352,7 @@ header nav .nav-item {
}
}
-// TOC hover indicator
-.toc-item a:not(.active):hover {
- background: var(--wt-color-bg-soft);
-}
+// TOC hover defined in .toc-item a:hover
// Logo hover effect
header .logo:hover img {
@@ -1379,15 +1360,7 @@ header .logo:hover img {
transition: filter 200ms ease;
}
-// Explore more bounce animation
-@keyframes gentle-bounce {
- 0%, 100% { transform: translateY(0); }
- 50% { transform: translateY(4px); }
-}
-
-button.explore-more {
- animation: gentle-bounce 2s ease-in-out infinite;
-}
+// button.explore-more uses .hero .explore-more animation (float keyframes)
// ============================================================================
// Dark Mode Adjustments
diff --git a/docs/templates/_variables.html b/docs/templates/_variables.html
index f26008a57..fa257f26b 100644
--- a/docs/templates/_variables.html
+++ b/docs/templates/_variables.html
@@ -49,6 +49,12 @@
--wt-header-height: 60px;
--wt-main-padding-top: 40px;
+ /* Border Radius Scale */
+ --wt-radius-sm: 0.25rem; /* 4px - small elements, TOC items */
+ --wt-radius-md: 0.5rem; /* 8px - buttons, inputs, cards */
+ --wt-radius-lg: 0.75rem; /* 12px - content cards, modals */
+ --wt-radius-pill: 999px; /* pill shapes */
+
/* Typography */
--wt-font-sans: "Inter", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
--wt-font-head: "Plus Jakarta Sans", var(--wt-font-sans);