Skip to content

Commit 1686e58

Browse files
authored
fix: various theme improvements (#22725)
Harmonize various areas of the theme.
1 parent 2c90601 commit 1686e58

File tree

9 files changed

+53
-36
lines changed

9 files changed

+53
-36
lines changed

assets/css/global.css

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,3 +104,6 @@ input[type="search"]::-ms-clear {
104104
list-style-type: lower-roman;
105105
}
106106
}
107+
.navbar-group:first-of-type {
108+
margin-top: 0.2rem !important;
109+
}

assets/css/utilities.css

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,9 +118,20 @@
118118
}
119119
}
120120

121+
@utility navbar-entry-margin {
122+
@apply px-2 py-1;
123+
}
124+
125+
@utility navbar-group {
126+
@apply mt-5;
127+
}
128+
129+
@utility navbar-entry-background-current {
130+
@apply bg-gray-100 dark:bg-gray-900;
131+
}
121132
@utility navbar-group-font-title {
122133
font-size: var(--color-navbar-group-font-title-size);
123-
@apply font-semibold uppercase;
134+
@apply pb-1.5 font-semibold uppercase;
124135
color: var(--color-navbar-text);
125136
.dark & {
126137
color: var(--color-navbar-text-dark);

layouts/_default/_markup/render-codeblock.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
>
4141
<button
4242
@click="collapse = false"
43-
class="bg-blue flex items-center rounded-full px-2 text-sm text-white dark:bg-blue-400"
43+
class="bg-blue flex items-center rounded-full px-2 text-sm text-white dark:bg-blue-500"
4444
>
4545
<span>Show more</span>
4646
<span class="icon-svg"
@@ -53,7 +53,7 @@
5353
<button
5454
@click="collapse = true"
5555
x-show="!collapse"
56-
class="rounded-sm-b-lg bg-blue mx-auto mt-4 flex items-center px-2 text-sm text-white dark:bg-blue-800"
56+
class="bg-blue mx-auto mt-4 flex items-center rounded-full px-2 text-sm text-white dark:bg-blue-500"
5757
>
5858
<span>Hide</span>
5959
<span class="icon-svg"

layouts/guides/single.html

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,6 @@
66
{{ define "main" }}
77
{{ partial "content-default.html" . }}
88
<div class="prose dark:prose-invert max-w-4xl">
9-
<div class="md-dropdown ml-auto hidden lg:block">
10-
{{ partial "md-dropdown.html" . }}
11-
</div>
129
{{ if (.Store.Get "multipage") }}
1310
{{- with .PrevInSection }}
1411
<div class="not-prose col-start-2 my-4">

layouts/index.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -293,19 +293,19 @@ <h2 class="text-2xl">Community resources</h2>
293293
<div class="flex flex-col gap-4 md:flex-row">
294294
<a
295295
href="https://forums.docker.com/"
296-
class="cursor-pointer rounded-sm bg-white px-4 py-2 hover:bg-gray-50 dark:bg-gray-400 dark:text-white dark:hover:bg-gray-500"
296+
class="cursor-pointer rounded-sm bg-white px-4 py-2 hover:bg-gray-50 dark:bg-gray-500 dark:text-white dark:hover:bg-gray-600"
297297
>
298298
Visit Docker Forum
299299
</a>
300300
<a
301301
href="https://dockr.ly/comm-slack"
302-
class="cursor-pointer rounded-sm bg-white px-4 py-2 hover:bg-gray-50 dark:bg-gray-400 dark:text-white dark:hover:bg-gray-500"
302+
class="cursor-pointer rounded-sm bg-white px-4 py-2 hover:bg-gray-50 dark:bg-gray-500 dark:text-white dark:hover:bg-gray-600"
303303
>
304304
Join Docker Slack
305305
</a>
306306
<a
307307
href="https://www.docker.com/community/captains/"
308-
class="cursor-pointer rounded-sm bg-white px-4 py-2 hover:bg-gray-50 dark:bg-gray-400 dark:text-white dark:hover:bg-gray-500"
308+
class="cursor-pointer rounded-sm bg-white px-4 py-2 hover:bg-gray-50 dark:bg-gray-500 dark:text-white dark:hover:bg-gray-600"
309309
>
310310
Find your Docker Captain
311311
</a>

layouts/partials/languages.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
{{- errorf "[languages] language is missing an icon: '%s' in %s" (urlize (strings.ToLower .Title)) page.File.Filename }}
1212
{{- end }}
1313
<span
14-
class="border-divider-light dark:border-divider-dark inline-flex items-center gap-1 rounded-full border bg-gray-100 px-2 text-sm text-gray-200 select-none dark:bg-gray-800 dark:text-gray-400"
14+
class="border-divider-light dark:border-divider-dark inline-flex items-center gap-1 rounded-full border bg-gray-100 px-2 text-sm text-gray-800 select-none dark:bg-gray-700 dark:text-gray-300"
1515
>
1616
<img
1717
class="py-1"

layouts/partials/search-bar.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@
6262
class="bg-background-light dark:bg-background-dark absolute top-full right-0 z-50 w-screen max-w-xl rounded-sm px-6 py-4 shadow-lg"
6363
>
6464
<div id="search-bar-results">
65-
{{- $emptyState := `<div class="p-2 text-gray-200 dark:text-gray-500">Start typing to search… or try <button @click="open=false" class="open-kapa-widget link">Ask AI</button></div>` }}
65+
{{- $emptyState := `<div class="p-2 text-gray-500 dark:text-gray-400">Start typing to search… or try <button @click="open=false" class="open-kapa-widget link">Ask AI</button></div>` }}
6666
{{- $emptyState | safe.HTML }}
6767
<!-- results -->
6868
</div>

layouts/partials/sidebar/guides.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
{{- end }}
2929
</div>
3030
{{- with ($root.Params.time) }}
31-
<div class="flex gap-2 text-gray-200 dark:text-gray-500">
31+
<div class="flex gap-2 text-gray-400 dark:text-gray-400">
3232
<span class="icon-svg"
3333
>{{ partialCached "icon" "schedule" "schedule" }}</span
3434
>

layouts/partials/sidebar/sections.html

Lines changed: 30 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -32,32 +32,36 @@
3232
{{- end }}
3333
{{- range .Params.sidebar.groups }}
3434
<!-- Main titles -->
35-
<li class="navbar-group-font-title mt-2 px-2 py-2 pt-5 pb-2">
36-
{{ . }}
37-
</li>
38-
{{- range where $pages "Params.sidebar.group" . }}
39-
{{- if .IsSection }}
40-
{{- template "renderList" . }}
41-
{{- else }}
42-
{{- template "renderSingle" . }}
35+
<div class="navbar-group">
36+
<li class="navbar-group-font-title">
37+
{{ . }}
38+
</li>
39+
{{- range where $pages "Params.sidebar.group" . }}
40+
{{- if .IsSection }}
41+
{{- template "renderList" . }}
42+
{{- else }}
43+
{{- template "renderSingle" . }}
44+
{{- end }}
4345
{{- end }}
44-
{{- end }}
46+
</div>
4547
{{- end }}
48+
4649
{{ end }}
4750

4851
{{/* Recursive template for sidebar items */}}
4952
{{ define "renderList" }}
5053
{{ $isCurrent := eq page . }}
5154
{{ $expanded := or $isCurrent (page.IsDescendant .) }}
52-
<li x-data="{ expanded: {{ $expanded }} }">
55+
<li class="" x-data="{ expanded: {{ $expanded }} }">
5356
<div
54-
class="justify-between{{ if $isCurrent }}
55-
bg-gray-100 dark:bg-gray-900
56-
{{ end }} flex w-full items-center rounded-sm px-4"
57+
class="{{ if $isCurrent }}
58+
navbar-entry-background-current
59+
{{ end }} flex w-full items-center justify-between rounded-sm"
5760
>
58-
<div class="w-full truncate py-1">
61+
<div class="navbar-entry-margin w-full truncate">
5962
{{- if .Permalink }}
6063
{{/* If the link is not empty, use it */}}
64+
<!-- Sections that have children and linking to a page -->
6165
<a
6266
{{ if $isCurrent }}
6367
aria-current="page" id="sidebar-current-page"
@@ -69,6 +73,7 @@
6973
</a>
7074
{{- else }}
7175
{{/* Otherwise, just expand the section */}}
76+
<!-- Sections that have children and do not link to a page -->
7277
<button
7378
@click="expanded = !expanded"
7479
class="hover:text-blue w-full text-left select-none hover:dark:text-blue-400"
@@ -77,9 +82,10 @@
7782
</button>
7883
{{- end }}
7984
</div>
85+
<!-- Expand group button -->
8086
<button
8187
@click="expanded = !expanded"
82-
class="rounded-sm hover:bg-gray-300 hover:dark:bg-gray-300"
88+
class="rounded-sm hover:bg-gray-200 hover:dark:bg-gray-800"
8389
>
8490
<span
8591
:class="{ 'hidden' : expanded }"
@@ -106,9 +112,9 @@
106112

107113
{{ define "renderSingle" }}
108114
{{- if .Params.sidebar.goto }}
109-
<li class="hover:text-blue px-4 hover:dark:text-blue-400">
115+
<li class="navbar-entry-margin hover:text-blue hover:dark:text-blue-400">
110116
<a
111-
class="block w-full truncate py-2"
117+
class="block w-full truncate"
112118
href="{{ .Params.sidebar.goto }}"
113119
title="{{ .LinkTitle }}"
114120
>
@@ -118,15 +124,15 @@
118124
{{- else }}
119125
{{ $isCurrent := eq page . }}
120126
<li
121-
class="hover:text-blue {{ if $isCurrent }}
122-
bg-gray-100 dark:bg-gray-900
123-
{{ end }} rounded-sm px-4 hover:dark:text-blue-400"
127+
class="navbar-entry-margin hover:text-blue {{ if $isCurrent }}
128+
navbar-entry-background-current
129+
{{ end }} rounded-sm hover:dark:text-blue-400"
124130
>
125131
<a
126132
{{ if $isCurrent }}
127133
aria-current="page" id="sidebar-current-page"
128134
{{ end }}
129-
class="block w-full truncate py-2"
135+
class="block w-full truncate"
130136
href="{{ .Permalink }}"
131137
title="{{ .LinkTitle }}"
132138
>
@@ -139,8 +145,8 @@
139145
{{ define "renderTitle" }}
140146
{{ .LinkTitle }}
141147
{{- with .Params.sidebar.badge }}
142-
<span
143-
>{{- partial "components/badge.html" (dict "color" .color "content" .text) }}</span
144-
>
148+
<span>
149+
{{- partial "components/badge.html" (dict "color" .color "content" .text) }}
150+
</span>
145151
{{- end }}
146152
{{ end }}

0 commit comments

Comments
 (0)