Skip to content

Commit 0317c77

Browse files
committed
Refactor styling to adopt orange themes and enhance component utilities in Tailwind CSS for improved visual consistency
1 parent 11470db commit 0317c77

File tree

2 files changed

+299
-20
lines changed

2 files changed

+299
-20
lines changed

src/tailwind.css

Lines changed: 260 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -46,18 +46,19 @@ Navigation elements excluded:
4646
- Any nav-specific elements
4747
*/
4848

49-
/* Make content hyperlinks blue, but keep navigation original colors */
49+
/* D3-inspired orange content links */
5050
@layer components {
51-
/* Only make content area links blue */
51+
/* Only make content area links orange (D3 style) */
5252
.sl-markdown-content a,
5353
.starlight-aside a,
5454
article a,
5555
main a,
5656
p a,
5757
ul:not(nav ul) li a,
5858
ol:not(nav ol) li a {
59-
color: #3b82f6 !important; /* Tailwind blue-500 - soft blue */
59+
color: #e04600 !important; /* D3 primary orange */
6060
text-decoration: none !important;
61+
transition: all 0.2s ease-in-out;
6162
}
6263

6364
.sl-markdown-content a:hover,
@@ -67,8 +68,29 @@ Navigation elements excluded:
6768
p a:hover,
6869
ul:not(nav ul) li a:hover,
6970
ol:not(nav ol) li a:hover {
70-
color: #2563eb !important; /* Tailwind blue-600 - slightly darker on hover */
71-
text-decoration: underline !important;
71+
color: #e85d14 !important; /* D3 secondary orange - lighter on hover */
72+
text-decoration: none !important;
73+
}
74+
75+
/* Dark mode adjustments for links */
76+
:root[data-theme="dark"] .sl-markdown-content a,
77+
:root[data-theme="dark"] .starlight-aside a,
78+
:root[data-theme="dark"] article a,
79+
:root[data-theme="dark"] main a,
80+
:root[data-theme="dark"] p a,
81+
:root[data-theme="dark"] ul:not(nav ul) li a,
82+
:root[data-theme="dark"] ol:not(nav ol) li a {
83+
color: #ff9852 !important; /* D3 dark mode orange */
84+
}
85+
86+
:root[data-theme="dark"] .sl-markdown-content a:hover,
87+
:root[data-theme="dark"] .starlight-aside a:hover,
88+
:root[data-theme="dark"] article a:hover,
89+
:root[data-theme="dark"] main a:hover,
90+
:root[data-theme="dark"] p a:hover,
91+
:root[data-theme="dark"] ul:not(nav ul) li a:hover,
92+
:root[data-theme="dark"] ol:not(nav ol) li a:hover {
93+
color: #ff823e !important; /* Slightly darker orange for dark mode hover */
7294
}
7395
}
7496

@@ -97,7 +119,7 @@ Navigation elements excluded:
97119
text-decoration: none !important;
98120
}
99121

100-
/* Hover states for navigation elements */
122+
/* Orange hover states for navigation elements */
101123
nav a:hover,
102124
[data-starlight-sidebar] a:hover,
103125
nav[aria-labelledby="starlight__sidebar-navigation"] a:hover,
@@ -110,38 +132,141 @@ Navigation elements excluded:
110132
.sl-flex a[rel="next"]:hover,
111133
footer a:hover,
112134
.starlight-aside .pagination a:hover {
113-
color: inherit !important;
135+
color: #e04600 !important; /* Orange hover for navigation */
114136
text-decoration: none !important;
137+
transition: all 0.2s ease-in-out !important;
115138
}
116139

117-
/* Fix active/selected page visibility - make text black on white background */
140+
/* Dark mode orange hover for navigation */
141+
:root[data-theme="dark"] nav a:hover,
142+
:root[data-theme="dark"] [data-starlight-sidebar] a:hover,
143+
:root[data-theme="dark"] nav[aria-labelledby="starlight__sidebar-navigation"] a:hover,
144+
:root[data-theme="dark"] details summary:hover,
145+
:root[data-theme="dark"] .sidebar a:hover {
146+
color: #ff9852 !important; /* Dark mode orange hover */
147+
}
148+
149+
/* Orange active/selected page styling with left bar */
118150
nav a[aria-current="page"],
119151
[data-starlight-sidebar] a[aria-current="page"],
120152
nav[aria-labelledby="starlight__sidebar-navigation"] a[aria-current="page"],
121153
.sidebar a[aria-current="page"],
122154
nav a.active,
123155
[data-starlight-sidebar] a.active,
124156
.sidebar a.active {
125-
color: #000000 !important; /* Black text for active/selected pages */
126-
background-color: rgba(255, 255, 255, 0.9) !important; /* Ensure white background */
157+
color: #e04600 !important; /* Orange text for active/selected pages */
158+
background-color: transparent !important; /* No background */
127159
font-weight: 600 !important; /* Make it slightly bolder for better visibility */
160+
border-left: 3px solid #e04600 !important; /* Orange left bar */
161+
padding-left: calc(1rem - 3px) !important; /* Adjust padding to account for border */
162+
transition: all 0.2s ease-in-out !important;
163+
}
164+
165+
/* Dark mode orange active states */
166+
:root[data-theme="dark"] nav a[aria-current="page"],
167+
:root[data-theme="dark"] [data-starlight-sidebar] a[aria-current="page"],
168+
:root[data-theme="dark"] nav[aria-labelledby="starlight__sidebar-navigation"] a[aria-current="page"],
169+
:root[data-theme="dark"] .sidebar a[aria-current="page"],
170+
:root[data-theme="dark"] nav a.active,
171+
:root[data-theme="dark"] [data-starlight-sidebar] a.active,
172+
:root[data-theme="dark"] .sidebar a.active {
173+
color: #ff9852 !important; /* Dark mode orange text */
174+
border-left-color: #ff9852 !important; /* Dark mode orange left bar */
128175
}
129176
}
130177

131-
/* Reusable red text utility for attention-grabbing content */
178+
/* D3-inspired utility classes and modern design elements */
132179
@layer utilities {
180+
/* Typography utilities (D3 style) */
181+
.f12 {
182+
font-size: 12px !important;
183+
}
184+
185+
.f14 {
186+
font-size: 14px !important;
187+
}
188+
189+
.fw6 {
190+
font-weight: 600 !important;
191+
}
192+
193+
.lh-normal {
194+
line-height: normal !important;
195+
}
196+
197+
.lh-1_5 {
198+
line-height: 1.5 !important;
199+
}
200+
201+
/* Layout utilities */
202+
.flex-grow-1 {
203+
flex-grow: 1 !important;
204+
}
205+
206+
.fb6 {
207+
flex-basis: 10rem !important;
208+
}
209+
210+
/* Spacing utilities */
211+
.ma4 {
212+
margin: 2rem !important;
213+
}
214+
215+
.ml1 {
216+
margin-left: 1rem !important;
217+
}
218+
219+
.mb2 {
220+
margin-bottom: 0.5rem !important;
221+
}
222+
223+
/* Glass morphism and backdrop blur */
224+
.glass {
225+
background: rgba(246, 246, 247, 0.5) !important;
226+
backdrop-filter: blur(10px) !important;
227+
-webkit-backdrop-filter: blur(10px) !important;
228+
}
229+
230+
.glass-dark {
231+
background: rgba(37, 37, 41, 0.5) !important;
232+
backdrop-filter: blur(10px) !important;
233+
-webkit-backdrop-filter: blur(10px) !important;
234+
}
235+
236+
/* Brand color utilities */
237+
.text-brand {
238+
color: #e04600 !important;
239+
}
240+
241+
.text-brand-light {
242+
color: #ef7234 !important;
243+
}
244+
245+
.text-brand-dark {
246+
color: #ff9852 !important;
247+
}
248+
249+
.bg-brand {
250+
background-color: #e04600 !important;
251+
}
252+
253+
.bg-brand-soft {
254+
background-color: rgba(239, 114, 52, 0.16) !important;
255+
}
256+
257+
/* Legacy red utilities */
133258
.text-red-attention {
134-
color: #ef4444 !important; /* Tailwind red-500 - bright but not harsh */
135-
font-weight: 500 !important; /* Slightly bolder for better visibility */
259+
color: #ef4444 !important;
260+
font-weight: 500 !important;
136261
}
137262

138263
.text-red-light {
139-
color: #f87171 !important; /* Tailwind red-400 - lighter, softer red */
264+
color: #f87171 !important;
140265
font-weight: 500 !important;
141266
}
142267

143268
.text-red-soft {
144-
color: #fca5a5 !important; /* Tailwind red-300 - very light, gentle red */
269+
color: #fca5a5 !important;
145270
font-weight: 500 !important;
146271
}
147272
}
@@ -199,3 +324,123 @@ Available properties to customize:
199324
.tippy-arrow {
200325
color: #374151 !important; /* Match background color */
201326
}
327+
328+
/* D3-inspired modern enhancements */
329+
@layer components {
330+
/* Code blocks with better styling */
331+
.sl-markdown-content pre,
332+
.sl-markdown-content code {
333+
line-height: 1.5 !important;
334+
}
335+
336+
.sl-markdown-content :not(pre) > code {
337+
background-color: var(--sl-color-gray-6) !important;
338+
padding: 0.125rem 0.25rem !important;
339+
border-radius: 0.25rem !important;
340+
font-size: 0.875em !important;
341+
}
342+
343+
/* Improved search styling (D3 inspired rounded search) */
344+
.search-input,
345+
input[type="search"] {
346+
border-radius: 1000px !important;
347+
transition: all 0.2s ease-in-out !important;
348+
}
349+
350+
/* Button and interactive element improvements */
351+
button,
352+
.sl-badge,
353+
.starlight-aside {
354+
transition: all 0.2s ease-in-out !important;
355+
}
356+
357+
/* Improved table styling */
358+
.sl-markdown-content table {
359+
border-collapse: collapse !important;
360+
}
361+
362+
.sl-markdown-content td,
363+
.sl-markdown-content th {
364+
white-space: nowrap !important;
365+
padding: 0.5rem 0.75rem !important;
366+
}
367+
368+
/* Enhanced figure captions */
369+
.sl-markdown-content figcaption {
370+
line-height: 20px !important;
371+
font-size: 12px !important;
372+
font-weight: 500 !important;
373+
color: var(--sl-color-text-accent) !important;
374+
margin-top: 0.5rem !important;
375+
}
376+
377+
/* Improved aside/callout styling */
378+
.starlight-aside {
379+
border-left-color: #e04600 !important;
380+
}
381+
382+
.starlight-aside.starlight-aside--tip {
383+
border-left-color: #e04600 !important;
384+
background-color: rgba(239, 114, 52, 0.08) !important;
385+
}
386+
387+
.starlight-aside.starlight-aside--note {
388+
border-left-color: #e85d14 !important;
389+
background-color: rgba(232, 93, 20, 0.08) !important;
390+
}
391+
392+
/* Header anchor improvements */
393+
.sl-markdown-content h1:hover .header-anchor,
394+
.sl-markdown-content h2:hover .header-anchor,
395+
.sl-markdown-content h3:hover .header-anchor,
396+
.sl-markdown-content h4:hover .header-anchor,
397+
.sl-markdown-content h5:hover .header-anchor,
398+
.sl-markdown-content h6:hover .header-anchor {
399+
opacity: 1 !important;
400+
color: #e04600 !important;
401+
}
402+
403+
/* Modern scrollbar (webkit browsers) */
404+
.sl-markdown-content *::-webkit-scrollbar {
405+
width: 6px !important;
406+
height: 6px !important;
407+
}
408+
409+
.sl-markdown-content *::-webkit-scrollbar-track {
410+
background: var(--sl-color-gray-6) !important;
411+
border-radius: 3px !important;
412+
}
413+
414+
.sl-markdown-content *::-webkit-scrollbar-thumb {
415+
background: var(--sl-color-accent) !important;
416+
border-radius: 3px !important;
417+
}
418+
419+
.sl-markdown-content *::-webkit-scrollbar-thumb:hover {
420+
background: var(--sl-color-accent-high) !important;
421+
}
422+
423+
/* Responsive layout improvements */
424+
@media (min-width: 768px) {
425+
.search-input {
426+
padding-right: 0.75rem !important;
427+
height: 2rem !important;
428+
}
429+
}
430+
}
431+
432+
/* Custom CSS variables for D3-inspired theming */
433+
:root {
434+
--brand-orange-1: #e04600;
435+
--brand-orange-2: #e85d14;
436+
--brand-orange-3: #ef7234;
437+
--brand-orange-soft: rgba(239, 114, 52, 0.16);
438+
--brand-orange-dark: #ff9852;
439+
--brand-font-family: -apple-system, BlinkMacSystemFont, "avenir next", avenir, helvetica, "helvetica neue", ubuntu, roboto, noto, "segoe ui", arial, sans-serif;
440+
}
441+
442+
:root[data-theme="dark"] {
443+
--brand-orange-1: #ff9852;
444+
--brand-orange-2: #ff823e;
445+
--brand-orange-3: #ef7234;
446+
}

tailwind.config.mjs

Lines changed: 39 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import starlightPlugin from "@astrojs/starlight-tailwind";
22

33
const accent = {
4-
200: "#c8c8c8",
5-
600: "#4e4e4e",
6-
900: "#323232",
7-
950: "#242424",
4+
200: "#ff9852", // Orange for dark mode
5+
600: "#e85d14", // Medium orange
6+
900: "#e04600", // Primary orange (D3 style)
7+
950: "#b83a00", // Darker orange
88
};
99
const gray = {
1010
100: "#f5f6f8",
@@ -22,7 +22,41 @@ export default {
2222
content: ["./src/**/*.{astro,html,js,jsx,md,mdx,svelte,ts,tsx,vue}"],
2323
theme: {
2424
extend: {
25-
colors: { accent, gray },
25+
colors: {
26+
accent,
27+
gray,
28+
orange: {
29+
50: "#fff7ed",
30+
100: "#ffedd5",
31+
200: "#fed7aa",
32+
300: "#fdba74",
33+
400: "#fb923c",
34+
500: "#f97316",
35+
600: "#ea580c",
36+
700: "#c2410c",
37+
800: "#9a3412",
38+
900: "#e04600", // D3 primary orange
39+
950: "#b83a00",
40+
},
41+
brand: {
42+
50: "#fff7ed",
43+
100: "#ffedd5",
44+
200: "#ff9852", // D3 dark mode orange
45+
300: "#ef7234",
46+
400: "#e85d14",
47+
500: "#e04600", // D3 primary orange
48+
600: "#c2410c",
49+
700: "#9a3412",
50+
800: "#7c2d12",
51+
900: "#431407",
52+
}
53+
},
54+
fontFamily: {
55+
sans: ['-apple-system', 'BlinkMacSystemFont', '"avenir next"', 'avenir', 'helvetica', '"helvetica neue"', 'ubuntu', 'roboto', 'noto', '"segoe ui"', 'arial', 'sans-serif'],
56+
},
57+
backdropBlur: {
58+
xs: '2px',
59+
}
2660
},
2761
},
2862
plugins: [starlightPlugin()],

0 commit comments

Comments
 (0)