Skip to content

Commit ab941b6

Browse files
committed
Update custom.css
1 parent eef6b79 commit ab941b6

1 file changed

Lines changed: 67 additions & 9 deletions

File tree

docs/cookbook/theme/custom.css

Lines changed: 67 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,47 @@
1-
/* Premium Dark Theme - RustAPI Cookbook */
1+
/* Premium Responsive Theme - RustAPI Cookbook */
22

33
:root {
4+
/* Default to Dark Theme variables (matches implicit defaults or dark modes) */
45
--bg-color: #0f172a;
56
--sidebar-bg: #1e293b;
67
--text-color: #e2e8f0;
78
--heading-color: #f8fafc;
8-
--accent-color: #06b6d4; /* Cyan */
9+
--accent-color: #06b6d4;
10+
/* Cyan */
911
--accent-hover: #22d3ee;
1012
--border-color: #334155;
1113
--code-bg: #1e293b;
1214
--link-color: #38bdf8;
15+
16+
/* Common Fonts */
17+
--font-primary: 'Inter', system-ui, -apple-system, sans-serif;
18+
--font-mono: 'JetBrains Mono', 'Fira Code', monospace;
19+
}
20+
21+
/* Light Theme Overrides */
22+
.light {
23+
--bg-color: #ffffff;
24+
--sidebar-bg: #f1f5f9;
25+
/* Slate 100 */
26+
--text-color: #334155;
27+
/* Slate 700 */
28+
--heading-color: #0f172a;
29+
/* Slate 900 */
30+
--accent-color: #0891b2;
31+
/* Cyan 600 - darker for contrast */
32+
--accent-hover: #06b6d4;
33+
--border-color: #e2e8f0;
34+
/* Slate 200 */
35+
--code-bg: #f8fafc;
36+
/* Slate 50 */
37+
--link-color: #0284c7;
38+
/* Sky 600 */
1339
}
1440

1541
body {
1642
background-color: var(--bg-color);
1743
color: var(--text-color);
18-
font-family: 'Inter', system-ui, -apple-system, sans-serif;
44+
font-family: var(--font-primary);
1945
}
2046

2147
/* Sidebar Styling */
@@ -29,18 +55,29 @@ body {
2955
scrollbar-color: var(--border-color) transparent;
3056
}
3157

32-
.chapter li.active > a {
58+
.chapter li.active>a {
3359
color: var(--accent-color);
3460
border-left: 2px solid var(--accent-color);
3561
background: rgba(6, 182, 212, 0.1);
36-
padding-left: 8px; /* Offset for border */
62+
padding-left: 8px;
63+
/* Offset for border */
64+
}
65+
66+
/* Adjust active chapter bg for light mode */
67+
.light .chapter li.active>a {
68+
background: rgba(8, 145, 178, 0.1);
3769
}
3870

3971
.chapter a {
4072
color: #94a3b8;
4173
transition: all 0.2s ease;
4274
}
4375

76+
.light .chapter a {
77+
color: #64748b;
78+
/* Slate 500 */
79+
}
80+
4481
.chapter a:hover {
4582
color: var(--heading-color);
4683
}
@@ -50,7 +87,10 @@ body {
5087
line-height: 1.8;
5188
}
5289

53-
h1, h2, h3, h4 {
90+
h1,
91+
h2,
92+
h3,
93+
h4 {
5494
color: var(--heading-color);
5595
font-weight: 700;
5696
margin-top: 2em;
@@ -66,6 +106,13 @@ h1 {
66106
display: inline-block;
67107
}
68108

109+
/* Darker gradient for Light Mode */
110+
.light h1 {
111+
background: linear-gradient(to right, #0891b2, #4f46e5);
112+
-webkit-background-clip: text;
113+
-webkit-text-fill-color: transparent;
114+
}
115+
69116
a {
70117
color: var(--link-color);
71118
text-decoration: none;
@@ -78,11 +125,12 @@ a:hover {
78125
}
79126

80127
/* Code Blocks */
81-
pre, code {
128+
pre,
129+
code {
82130
background-color: var(--code-bg);
83131
border-radius: 8px;
84132
border: 1px solid var(--border-color);
85-
font-family: 'JetBrains Mono', 'Fira Code', monospace;
133+
font-family: var(--font-mono);
86134
}
87135

88136
pre {
@@ -100,6 +148,12 @@ blockquote {
100148
color: #cbd5e1;
101149
}
102150

151+
.light blockquote {
152+
background: rgba(59, 130, 246, 0.05);
153+
color: #334155;
154+
border-left-color: #2563eb;
155+
}
156+
103157
/* Table Styling */
104158
table {
105159
border-collapse: separate;
@@ -132,6 +186,10 @@ tr:hover td {
132186
background-color: rgba(255, 255, 255, 0.02);
133187
}
134188

189+
.light tr:hover td {
190+
background-color: rgba(0, 0, 0, 0.02);
191+
}
192+
135193
/* Scrollbars */
136194
::-webkit-scrollbar {
137195
width: 8px;
@@ -149,4 +207,4 @@ tr:hover td {
149207

150208
::-webkit-scrollbar-thumb:hover {
151209
background: #475569;
152-
}
210+
}

0 commit comments

Comments
 (0)