summaryrefslogtreecommitdiff
path: root/layouts/_partials
diff options
context:
space:
mode:
authorEltrac <hi@guhub.cn>2025-07-17 11:25:10 +0800
committerEltrac <hi@guhub.cn>2025-07-17 11:25:10 +0800
commitec41236bc88a0762656413c38044ffa256bd93cb (patch)
tree2d6f685fbe9ebb998e29dfcc9d1db9289238c1fe /layouts/_partials
parent1160eda3a7de8ffaf1562e65187cec783081d491 (diff)
refactor: avoid using straight value in UnoCSS
Diffstat (limited to 'layouts/_partials')
-rw-r--r--layouts/_partials/components/global-search.html2
-rw-r--r--layouts/_partials/footer.html10
-rw-r--r--layouts/_partials/header.html10
-rw-r--r--layouts/_partials/home/home-nav.html2
-rw-r--r--layouts/_partials/home/latest-cards.html4
-rw-r--r--layouts/_partials/items/book.html2
-rw-r--r--layouts/_partials/items/card.html4
-rw-r--r--layouts/_partials/items/post-small.html4
-rw-r--r--layouts/_partials/items/post.html4
-rw-r--r--layouts/_partials/posts/comment.html2
-rw-r--r--layouts/_partials/posts/endnotes.html2
-rw-r--r--layouts/_partials/posts/now-read-this.html4
-rw-r--r--layouts/_partials/taxonomy/tag-pill.html4
13 files changed, 27 insertions, 27 deletions
diff --git a/layouts/_partials/components/global-search.html b/layouts/_partials/components/global-search.html
index a4b82122..aa654306 100644
--- a/layouts/_partials/components/global-search.html
+++ b/layouts/_partials/components/global-search.html
@@ -18,7 +18,7 @@
<div id="global-search-container">
<div id="global-search"
class="fixed -z-10 hidden top-0 left-0 right-0 bottom-0 items-center justify-center">
- <div id="global-search-close" class="absolute top-0 right-0 px-4 text-[3rem] cursor-pointer">×</div>
+ <div id="global-search-close" class="absolute top-0 right-0 px-4 text-12 cursor-pointer">×</div>
<!-- Pagefind Search -->
<div id="pagefind" class="max-h-[90vh] overflow-y-auto w-full m-4 md:w-[600px]"></div>
<script>
diff --git a/layouts/_partials/footer.html b/layouts/_partials/footer.html
index 6f9a9126..776e12a9 100644
--- a/layouts/_partials/footer.html
+++ b/layouts/_partials/footer.html
@@ -1,4 +1,4 @@
-<footer class="my-[2rem] mx-auto font-mono
+<footer class="my-8 mx-auto font-mono
md:w-[var(--page-width)] md:flex md:justify-between">
<!-- copyright -->
<section>
@@ -8,10 +8,10 @@
<!-- links -->
<section class="flex flex-col md:items-end">
<!-- Internal Links -->
- <ul class="list-none flex gap-[0.25rem] ps-0 my-[0.5rem] mx-0 md:justify-end">
+ <ul class="list-none flex gap-1 ps-0 my-2 mx-0 md:justify-end">
{{ range .Site.Params.footerInternalLinks }}
<li><a href="{{ .link }}" title="{{ .name }}">{{ .name }}</a></li>
- <li class="font-secondary last:hidden ml-[0.25rem]">/</li>
+ <li class="font-secondary last:hidden ml-1">/</li>
{{ end }}
<li class="inline-flex items-center">
{{ if eq .Site.Language.Lang "en" }}
@@ -25,10 +25,10 @@
</ul>
<!-- External Links -->
- <ul class="list-style-none flex gap-[0.5rem] ps-0 my-[0.5rem] mx-0 md:justify-end">
+ <ul class="list-style-none flex gap-2 ps-0 my-2 mx-0 md:justify-end">
{{ range .Site.Params.footerExternalLinks }}
<li class="inline-flex items-center"><a href="{{ .link }}" title="{{ .name }}" target="_blank">
- <img class="h-[1rem] w-auto inline-block rounded-full grayscale dark:invert" src="{{ .icon }}" />
+ <img class="h-4 w-auto inline-block rounded-full grayscale dark:invert" src="{{ .icon }}" />
</a></li>
{{ end }}
</ul>
diff --git a/layouts/_partials/header.html b/layouts/_partials/header.html
index 04ea6695..f379711c 100644
--- a/layouts/_partials/header.html
+++ b/layouts/_partials/header.html
@@ -1,18 +1,18 @@
<header id="site-header">
<!-- Header Title -->
- <div class="flex flex-col items-center gap-[0.5rem]">
+ <div class="flex flex-col items-center gap-2">
{{ partial "components/logo" (dict "imageClass" "w-[10rem]") }}
- <a class="text-[2rem] font-900 text-center tracking-[.15rem]
+ <a class="text-8 font-900 text-center tracking-widest
xerox underline-offset-10 underline-3"
href="{{ .Site.LanguagePrefix }}/"
>{{ .Site.Title }}</a
>
</div>
<!-- Navigation -->
- <div class="flex justify-center items-center gap-[0.75rem] pl-[1rem]">
- <nav class="my-[1rem] flex justify-center items-center w-fit rounded-[1rem] overflow-hidden">
+ <div class="flex justify-center items-center gap-3 pl-4">
+ <nav class="my-4 flex justify-center items-center w-fit rounded-4 overflow-hidden">
{{ range .Site.Params.nav }}
- <a class="inline-block py-[0.25rem] px-[0.5rem] first:pl-[0.75rem] last:pr-[0.75rem]
+ <a class="inline-block py-1 px-2 first:pl-3 last:pr-3
block hover:no-underline
{{ if strings.Contains $.Page.RelPermalink .link }}
text-[var(--text-color)] bg-[var(--block-background-color)]
diff --git a/layouts/_partials/home/home-nav.html b/layouts/_partials/home/home-nav.html
index 34ea9a8a..69e48615 100644
--- a/layouts/_partials/home/home-nav.html
+++ b/layouts/_partials/home/home-nav.html
@@ -19,7 +19,7 @@
(strings.HasPrefix $.Page.RelPermalink "/tags/"))
) }}
{{ end }}
- <li id="search-instruction" class="text-[0.9rem] font-secondary ml-2">
+ <li id="search-instruction" class="text-size-sm font-secondary ml-2">
<span>{{ T "searchInstruction" }}</span>
</li>
<li class="absolute right-0 invert-if-dark">
diff --git a/layouts/_partials/home/latest-cards.html b/layouts/_partials/home/latest-cards.html
index 28a3a2f9..220a0d94 100644
--- a/layouts/_partials/home/latest-cards.html
+++ b/layouts/_partials/home/latest-cards.html
@@ -1,7 +1,7 @@
{{ if eq .Site.Language.Lang "zh" }}
<!-- Latest Cards -->
-<section class="my-[1rem]">
- <div class="p-[5px] flex w-full overflow-x-auto gap-[1rem] items-stretch">
+<section class="my-4">
+ <div class="p-[5px] flex w-full overflow-x-auto gap-4 items-stretch">
{{- $cards := .Site.GetPage "section" "cards" }} <!-- 获取 "cards" 部分的内容 -->
{{- $paginator := .Paginate $cards.Pages 4 }} <!-- 对该部分内容进行分页 -->
{{- range $paginator.Pages }}
diff --git a/layouts/_partials/items/book.html b/layouts/_partials/items/book.html
index ff5dbe99..dca2961b 100644
--- a/layouts/_partials/items/book.html
+++ b/layouts/_partials/items/book.html
@@ -1,7 +1,7 @@
<div{{ if eq .Params.rating 1 }} class="opacity-50 z-0"{{ end }}
style="view-transition-name: book-{{ .File.UniqueID }}">
<a href="{{ .Permalink }}" style="view-transition-name: book-{{ .Title }}"
- class="border-[0.2rem] border-solid rotate-[3deg] shadow-md block
+ class="border-3 border-solid rotate-3 shadow-md block
hover:rotate-0 hover:-translate-y-2 hover:scale-110 transition
{{ if eq .Params.rating 1 }} relative
diff --git a/layouts/_partials/items/card.html b/layouts/_partials/items/card.html
index b66bf676..d0ab6f00 100644
--- a/layouts/_partials/items/card.html
+++ b/layouts/_partials/items/card.html
@@ -1,6 +1,6 @@
{{ $ctx := .context }}
{{ $showSummary := .summary }}
-<div class="relative p-[1.5rem] bg-white dark:bg-neutral-800 rounded-lg shadow-md border border-gray-200 dark:border-gray-700"
+<div class="relative p-6 bg-white dark:bg-neutral-800 rounded-lg shadow-md border border-gray-200 dark:border-gray-700"
style="view-transition-name: card-{{ $ctx.File.UniqueID }}">
<div class="card-header">
<h3 class="text-xl font-extrabold m-0 text-gray-900 dark:text-gray-100"
@@ -12,7 +12,7 @@
</h3>
<div class="text-base m-0">{{ partial "components/tags" $ctx }}</div>
</div>
- <div class="text-lg mt-2 markdown-body">
+ <div class="text-lg mt-2 leading-loose markdown-body">
{{ if $showSummary }}{{ $ctx.Summary }}{{ else }}{{ $ctx.Content }}{{ end }}
</div>
</div>
diff --git a/layouts/_partials/items/post-small.html b/layouts/_partials/items/post-small.html
index 39d6ae5c..30cbf60f 100644
--- a/layouts/_partials/items/post-small.html
+++ b/layouts/_partials/items/post-small.html
@@ -1,9 +1,9 @@
-<li class="flex justify-between text-[1.1rem]">
+<li class="flex justify-between text-size-lg">
<a href="{{ .RelPermalink }}" data-umami-event="🗃️ Click Post Link from Category Page">
{{ .Title }}{{ with .Params.subtitle }}:<span class="font-secondary">{{. }}</span>
{{ end }}
</a>
- <time class="text-[0.9rem] font-mono font-secondary flex-shrink-0">
+ <time class="text-size-sm font-mono font-secondary flex-shrink-0">
{{ .Date.Format "2006-1-2" }}
</time>
</li>
diff --git a/layouts/_partials/items/post.html b/layouts/_partials/items/post.html
index 10471180..1adf86af 100644
--- a/layouts/_partials/items/post.html
+++ b/layouts/_partials/items/post.html
@@ -21,7 +21,7 @@
{{ end }}
</a>
{{ if eq .ctx.Section "fictions" }}
- <span class="font-normal text-[1rem] text-[var(--secondary-text-color)]">小说</span>
+ <span class="font-normal text-4 text-[var(--secondary-text-color)]">小说</span>
{{ end }}
</h2>
</div>
@@ -34,7 +34,7 @@
{{ end }}
</header>
{{ if $showSummary }}
- <div class="markdown-body text-[1.1rem]"
+ <div class="markdown-body text-size-lg!"
style="view-transition-name: post-content-{{ .File.UniqueID }}">
{{ .ctx.Summary }}
</div>
diff --git a/layouts/_partials/posts/comment.html b/layouts/_partials/posts/comment.html
index 18bc479a..2a0f1027 100644
--- a/layouts/_partials/posts/comment.html
+++ b/layouts/_partials/posts/comment.html
@@ -12,7 +12,7 @@
<div>
{{ .content | safeHTML }}
</div>
- <div class="text-[1rem] text-right font-secondary">
+ <div class="text-4 text-right font-secondary">
{{ with .source }}
<p class="font-mono">{{ T "postPage.originallyPostedOn" . }}</p>
{{ end }}
diff --git a/layouts/_partials/posts/endnotes.html b/layouts/_partials/posts/endnotes.html
index 43c8fe74..83004f0f 100644
--- a/layouts/_partials/posts/endnotes.html
+++ b/layouts/_partials/posts/endnotes.html
@@ -1,6 +1,6 @@
{{ if .Params.endnotes }}
<hr>
-<div id="post-endnotes" class="font-secondary text-[1rem]">
+<div id="post-endnotes" class="font-secondary text-4">
<ul class="list-none">
{{ range .Params.endnotes }}
<li class="flex gap-4 pl-4"><span>→</span> {{ . | markdownify }}</li>
diff --git a/layouts/_partials/posts/now-read-this.html b/layouts/_partials/posts/now-read-this.html
index 2c894f27..8a9be489 100644
--- a/layouts/_partials/posts/now-read-this.html
+++ b/layouts/_partials/posts/now-read-this.html
@@ -1,6 +1,6 @@
{{ with site.RegularPages.Related . | first 1 }}
-<div class="mt-8 pb-8 relative leading-[2]">
- <h4 class="absolute -z-1 bottom-0 right-0 text-[2rem] m-0 opacity-25 font-italic">{{ T "nowReadThis" }}</h4>
+<div class="mt-8 pb-8 relative leading-loose">
+ <h4 class="absolute -z-1 bottom-0 right-0 text-8 m-0 opacity-25 font-italic">{{ T "nowReadThis" }}</h4>
{{ range . }}
<div class="flex justify-between">
<a class="font-800" href="{{ .RelPermalink }}" data-umami-event="🤔 Click Related Post">
diff --git a/layouts/_partials/taxonomy/tag-pill.html b/layouts/_partials/taxonomy/tag-pill.html
index 3eb8d695..ad13c62e 100644
--- a/layouts/_partials/taxonomy/tag-pill.html
+++ b/layouts/_partials/taxonomy/tag-pill.html
@@ -1,5 +1,5 @@
<a href="{{ .Page.RelPermalink }}"
- class="inline-flex items-center gap-2 text-[0.9rem] px-2 py-1
+ class="inline-flex items-center gap-2 text-size-sm px-2 py-1
transition-colors duration-300 rounded-md hover:no-underline
{{ if lt .Count 4 }}
@@ -20,5 +20,5 @@
{{ end }}
{{ end }}
<span>{{ if not .Page.Params.icon }}#{{ end }}{{ .Page.LinkTitle }}</span>
- <span class="text-[0.8rem] text-[var(--secondary-text-color)]">{{ .Count }}</span>
+ <span class="text-size-xs text-[var(--secondary-text-color)]">{{ .Count }}</span>
</a>