Skip to content

Commit 5e625b4

Browse files
committed
docs: improve typography smoothness and fix navbar theme consistency
Enable antialiased font rendering, add tighter letter-spacing on headings, improve line-height for body text, and reduce heading font-weight for a smoother look. Pin navbar to dark theme so it stays consistent across light/dark mode switches.
1 parent a85a807 commit 5e625b4

2 files changed

Lines changed: 42 additions & 5 deletions

File tree

docs/assets/scss/_styles_project.scss

Lines changed: 41 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1019,6 +1019,24 @@ h2.section-title {
10191019
// Typography & Links (Light mode defaults)
10201020
// ============================================================
10211021

1022+
// Smooth font rendering for doc pages
1023+
.td-main, .td-sidebar {
1024+
-webkit-font-smoothing: antialiased;
1025+
-moz-osx-font-smoothing: grayscale;
1026+
text-rendering: optimizeLegibility;
1027+
}
1028+
1029+
.td-content {
1030+
font-size: 1rem;
1031+
line-height: 1.75;
1032+
letter-spacing: -0.01em;
1033+
1034+
p, li {
1035+
line-height: 1.75;
1036+
letter-spacing: -0.01em;
1037+
}
1038+
}
1039+
10221040
p > a, li > a {
10231041
color: $purple;
10241042

@@ -1034,6 +1052,7 @@ p > a, li > a {
10341052
.td-sidebar-nav__section-title a {
10351053
color: #1e293b !important;
10361054
font-weight: 600;
1055+
letter-spacing: -0.01em;
10371056
&:hover {
10381057
color: $purple !important;
10391058
}
@@ -1043,6 +1062,9 @@ p > a, li > a {
10431062
.td-sidebar-nav {
10441063
.td-sidebar-link {
10451064
color: #475569;
1065+
font-size: 0.9375rem;
1066+
letter-spacing: -0.01em;
1067+
line-height: 1.5;
10461068
&:hover {
10471069
color: $purple;
10481070
}
@@ -1083,18 +1105,32 @@ p > a, li > a {
10831105
}
10841106

10851107
.td-content h1 {
1086-
font-weight: 800;
1108+
font-weight: 700;
10871109
color: $dark-base;
1110+
letter-spacing: -0.03em;
1111+
line-height: 1.2;
10881112
}
10891113

10901114
.td-content h2 {
1091-
font-weight: 800;
1115+
font-weight: 700;
10921116
color: $dark-base;
1117+
letter-spacing: -0.02em;
1118+
line-height: 1.25;
1119+
margin-top: 2rem;
10931120
}
10941121

10951122
.td-content h3 {
1096-
font-weight: 700;
1123+
font-weight: 600;
10971124
color: #1e293b;
1125+
letter-spacing: -0.015em;
1126+
line-height: 1.3;
1127+
}
1128+
1129+
.td-content h4 {
1130+
font-weight: 600;
1131+
color: #334155;
1132+
letter-spacing: -0.01em;
1133+
line-height: 1.35;
10981134
}
10991135

11001136
h3 > code {
@@ -1131,7 +1167,8 @@ h3 > code {
11311167
th {
11321168
background-color: #f8fafc;
11331169
color: $dark-base;
1134-
font-weight: 700;
1170+
font-weight: 600;
1171+
letter-spacing: -0.01em;
11351172
border-bottom: 2px solid #e2e8f0;
11361173
}
11371174

docs/layouts/partials/navbar.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
{{ $baseURL := urls.Parse $.Site.Params.Baseurl -}}
66

77
<nav class="td-navbar navbar-dark js-navbar-scroll
8-
{{- if $cover }} td-navbar-cover {{- end }}">
8+
{{- if $cover }} td-navbar-cover {{- end }}" data-bs-theme="dark">
99
<div class="container-fluid flex-column flex-md-row">
1010
<a class="navbar-brand" href="{{ .Site.Home.RelPermalink }}">
1111
{{- /**/ -}}

0 commit comments

Comments
 (0)