Skip to content

Commit 9eff1ba

Browse files
authored
theme: extract more styles (#22734)
Extract shared styling into appropriate utilities. Improve toc width.
1 parent dc01252 commit 9eff1ba

File tree

10 files changed

+22
-21
lines changed

10 files changed

+22
-21
lines changed

.vscode/docker.code-snippets

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,4 +39,9 @@
3939
],
4040
"description": "Insert a Hugo tabs block with two tabs and snippet stops for names and content",
4141
},
42+
"Insert a Button": {
43+
"prefix": ["button"],
44+
"body": ["{{< button url=\"$1\" text=\"$2\" >}}"],
45+
"description": "Insert a Hugo button",
46+
},
4247
}

assets/css/components.css

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,9 @@
9494
@apply h-12 w-12 overflow-hidden;
9595
}
9696
}
97+
.button {
98+
@apply mt-1 inline-block rounded-sm bg-blue-500 p-1 px-3 text-blue-50 text-white hover:bg-blue-600 dark:bg-blue-500 hover:dark:bg-blue-400;
99+
}
97100

98101
.summary-bar {
99102
@apply my-1 mt-4 flex flex-col rounded-sm border-1 border-gray-100 bg-gray-50 p-4 dark:border-gray-800 dark:bg-gray-900;

assets/css/utilities.css

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -251,3 +251,6 @@
251251
}
252252
}
253253
}
254+
@utility chip {
255+
@apply 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-200;
256+
}

content/get-started/introduction/get-docker-desktop.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ This guide will walk you through the installation process, enabling you to exper
2626
> Commercial use of Docker Desktop in larger enterprises (more than 250
2727
> employees OR more than $10 million USD in annual revenue) requires a [paid subscription](https://www.docker.com/pricing/?_gl=1*1nyypal*_ga*MTYxMTUxMzkzOS4xNjgzNTM0MTcw*_ga_XJWPQMJYHQ*MTcxNjk4MzU4Mi4xMjE2LjEuMTcxNjk4MzkzNS4xNy4wLjA.).
2828
29+
<div class="not-prose">
2930
{{< card
3031
title="Docker Desktop for Mac"
3132
description="[Download (Apple Silicon)](https://desktop.docker.com/mac/main/arm64/Docker.dmg?utm_source=docker&utm_medium=webreferral&utm_campaign=docs-driven-download-mac-arm64) | [Download (Intel)](https://desktop.docker.com/mac/main/amd64/Docker.dmg?utm_source=docker&utm_medium=webreferral&utm_campaign=docs-driven-download-mac-amd64) | [Install instructions](/desktop/setup/install/mac-install)"
@@ -40,7 +41,7 @@ This guide will walk you through the installation process, enabling you to exper
4041
title="Docker Desktop for Linux"
4142
description="[Install instructions](/desktop/setup/install/linux/)"
4243
icon="/icons/Linux.svg" >}}
43-
44+
</div>
4445

4546
Once it's installed, complete the setup process and you're all set to run a Docker container.
4647

layouts/_default/baseof.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
}
3030
}
3131
})"
32-
class="bg-background-toc dark:bg-background-toc fixed top-0 z-40 hidden h-screen w-full flex-none overflow-x-hidden overflow-y-auto md:sticky md:top-16 md:z-auto md:block md:h-[calc(100vh-64px)] md:w-[300px]"
32+
class="bg-background-toc dark:bg-background-toc fixed top-0 z-40 hidden h-screen w-full flex-none overflow-x-hidden overflow-y-auto md:sticky md:top-16 md:z-auto md:block md:h-[calc(100vh-64px)] md:w-[320px]"
3333
:class="{ 'hidden': ! $store.showSidebar }"
3434
>
3535
<!-- Gray backdrop on small screens -->
@@ -40,7 +40,7 @@
4040
x-transition.opacity
4141
></div>
4242
<div
43-
class="bg-background-toc dark:bg-background-toc z-50 w-full p-4 md:block md:w-[300px]"
43+
class="bg-background-toc dark:bg-background-toc z-50 w-full p-3 md:block md:w-[300px]"
4444
>
4545
<!-- Collapse button for small screens -->
4646
<button class="my-4 md:hidden" @click="$store.showSidebar = false">

layouts/guides/landing.html

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ <h2 x-show="noFilters()" id="all-guides" class="scroll-mt-36">
239239

240240
{{- define "guide-metadata" }}
241241
<div
242-
class="flex items-center justify-between gap-8 text-sm text-gray-200 dark:text-gray-300"
242+
class="flex items-center justify-between gap-8 text-sm text-gray-400 dark:text-gray-300"
243243
>
244244
<div class="flex flex-wrap gap-2 md:flex-nowrap">
245245
{{- $langs := .GetTerms "languages" }}
@@ -261,9 +261,7 @@ <h2 x-show="noFilters()" id="all-guides" class="scroll-mt-36">
261261
{{- end }}
262262

263263
{{- define "termchip" }}
264-
<span
265-
class="border-divider-light dark:border-divider-dark inline-flex min-w-0 items-center rounded-full border bg-gray-100 px-2 text-sm whitespace-nowrap text-gray-200 select-none dark:bg-gray-800 dark:text-gray-300"
266-
>
264+
<span class="chip">
267265
<span class="icon-svg icon-sm pb-0.5">
268266
{{ partialCached "icon" "tag" "tag" }}
269267
</span>

layouts/partials/components/guide-summary.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<div class="not-prose">
22
<div
3-
class="m-4 flex flex-col gap-4 bg-gray-200 p-6 sm:flex-row dark:bg-gray-300"
3+
class="mt-1.5 mb-1.5 flex flex-col gap-4 rounded-sm bg-gray-100 p-6 sm:flex-row dark:bg-gray-800"
44
>
55
<div class="flex flex-grow flex-col sm:items-center">
66
<span><strong>Skill level</strong></span>

layouts/partials/languages.html

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,7 @@
1010
{{- if not .Page.Params.icon }}
1111
{{- errorf "[languages] language is missing an icon: '%s' in %s" (urlize (strings.ToLower .Title)) page.File.Filename }}
1212
{{- end }}
13-
<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-800 select-none dark:bg-gray-700 dark:text-gray-300"
15-
>
13+
<span class="chip">
1614
<img
1715
class="py-1"
1816
height="18"

layouts/partials/tags.html

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,7 @@
77
{{- if eq .File nil }}
88
{{- errorf "[tags] Undefined tag: '%s' in %s" (urlize (strings.ToLower .Title)) page.File.Filename }}
99
{{- end }}
10-
<a
11-
class="border-divider-light dark:border-divider-dark bg-gray-00 inline-flex items-center rounded-full border px-2 text-sm text-gray-800 select-none hover:bg-gray-100 dark:bg-gray-800 dark:text-gray-200 hover:dark:bg-gray-700"
12-
href="{{ .Permalink }}"
13-
>
10+
<a class="chip" href="{{ .Permalink }}">
1411
<span class="icon-svg icon-sm pb-0.5">
1512
{{ partialCached "icon" "tag" "tag" }}
1613
</span>

layouts/shortcodes/button.html

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,6 @@
77
{{- else -}}
88
{{ $url = ref .Page $url }}
99
{{- end -}}
10-
<div class="not-prose my-4">
11-
<a
12-
href="{{ $url }}"
13-
class="cursor-pointer rounded-sm bg-blue-500 px-4 py-2 text-white hover:bg-blue-400 dark:bg-blue-800 dark:hover:bg-blue-700"
14-
>{{ $text }}</a
15-
>
10+
<div class="button not-prose">
11+
<a href="{{ $url }}">{{ $text }}</a>
1612
</div>

0 commit comments

Comments
 (0)