fix: visual height inconsistency between chinese and english title font

This commit is contained in:
radishzzz 2025-03-15 21:55:06 +00:00
parent dc260f3f6c
commit 26a3cce66e
5 changed files with 11 additions and 11 deletions

Binary file not shown.

View file

@ -19,7 +19,7 @@ const marginBottom = {
---
<header class="mb-10.625 lg:hidden">
<h3 class={`${marginBottom} mt-2.9375 text-5.375 c-secondary font-bold font-title`}>
<h3 class={`${marginBottom} mt-3 text-5.375 c-secondary font-bold font-title`}>
<!-- Fix text cropping issues during view transition on ios by adding a div tag -->
<div
class="box-content inline-block pr-1.25"

View file

@ -1,5 +1,5 @@
---
import { getNextLangUrl, getPostNextLangUrl } from '@/i18n/path'
import { getNextLangUrl, getNextSupportedLangUrl } from '@/i18n/path'
import { isPostPage, isTagPage } from '@/utils/page'
interface Props {
@ -11,13 +11,13 @@ const currentPath = Astro.url.pathname
const isPost = isPostPage(currentPath)
const isTag = isTagPage(currentPath)
// 检查是否应使用受限的语言列表
const useFilteredLangs = isPost || (isTag && supportedLangs.length > 0)
// Check if only the supported language switch list is used
const useSupportedLangs = isPost || (isTag && supportedLangs.length > 0)
// 根据页面类型选择合适的语言切换方式
const nextUrl = useFilteredLangs
? getPostNextLangUrl(currentPath, supportedLangs) // 只在有内容的语言间切换
: getNextLangUrl(currentPath) // 在所有语言间切换
// Choose a language switch list according to the page type
const nextUrl = useSupportedLangs
? getNextSupportedLangUrl(currentPath, supportedLangs) // Switch between supported languages
: getNextLangUrl(currentPath) // Switch between all languages
---
<a

View file

@ -75,7 +75,7 @@ export function getNextLangUrl(currentPath: string): string {
* @param supportedLangs
* @returns URL
*/
export function getPostNextLangUrl(currentPath: string, supportedLangs: string[]): string {
export function getNextSupportedLangUrl(currentPath: string, supportedLangs: string[]): string {
// 从路径提取当前语言
const currentLang = getLangFromPath(currentPath)

View file

@ -48,7 +48,7 @@ const footerMarginClass = isPost && themeConfig.comment?.waline?.serverURL
<!-- content width: calc(32rem+(100vw-1024px)*(44rem-32rem)/(1280-1024))=calc(75vw-16rem) / gap width: calc(6.75rem+(100vw-1024px)*(10.75rem-6.75rem)/(1280-1024))=calc(25vw-9.25rem) -->
<div
class="mx-auto max-w-205.848 min-h-vh w-full min-h-dvh"
p="x-[min(7.25vw,3.731rem)] y-8 lg:(x-22.5 y-20)"
p="x-[min(7.25vw,3.731rem)] y-9 lg:(x-22.5 y-20)"
lg="max-w-320 grid cols-[min(calc(75vw-16rem),44rem)_14rem] gap-[min(calc(25vw-9.25rem),10.75rem)]"
>
<!-- hide header and navigation on mobile for post pages -->
@ -75,7 +75,7 @@ const footerMarginClass = isPost && themeConfig.comment?.waline?.serverURL
<!-- <PhotoSwipe /> -->
<!-- only show on mobile (fix position issue on ios / fix right distance)-->
<div class="absolute right-7.25vw top-13.5 flex gap-6 [@supports(-webkit-touch-callout:none)]:top-12.5 min-[823px]:right-[calc(50vw-22rem)] lg:hidden">
<div class="absolute right-7.25vw top-13.6 flex gap-6 [@supports(-webkit-touch-callout:none)]:top-12.6 min-[823px]:right-[calc(50vw-22rem)] lg:hidden">
<LanguageSwitcher supportedLangs={supportedLangs} />
<ThemeToggle />
</div>