From 8eb0876c010bf8e2c39c38e82ca52c7cb712c044 Mon Sep 17 00:00:00 2001 From: radishzzz Date: Sun, 19 Jan 2025 03:49:50 +0000 Subject: [PATCH] fix: title font style --- pnpm-lock.yaml | 27 ++++++++++++++++----------- src/layouts/Layout.astro | 4 +++- src/styles/global.css | 21 +++++++++++++++++++++ uno.config.ts | 23 +---------------------- 4 files changed, 41 insertions(+), 34 deletions(-) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 1ab1d49..afbedf2 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -200,6 +200,9 @@ packages: '@antfu/utils@0.7.10': resolution: {integrity: sha512-+562v9k4aI80m1+VuMHehNJWLOFjBnXn3tdOitzD0il5b7smkSBal4+a3oKiQTbrwMmN/TBUMDvbdoWDehgOww==} + '@antfu/utils@8.1.0': + resolution: {integrity: sha512-XPR7Jfwp0FFl/dFYPX8ZjpmU4/1mIXTjnZ1ba48BLMyKOV62/tiRjdsFcPs2hsYcSud4tzk7w3a3LjX8Fu3huA==} + '@astrojs/check@0.9.4': resolution: {integrity: sha512-IOheHwCtpUfvogHHsvu0AbeRZEnjJg3MopdLddkJE70mULItS/Vh37BHcI00mcOJcH1vhD3odbpvWokpxam7xA==} hasBin: true @@ -2194,8 +2197,8 @@ packages: caniuse-api@3.0.0: resolution: {integrity: sha512-bsTwuIg/BZZK/vreVTYYbSWoe2F+71P7K5QGEX+pT250DZbfU1MQ5prOKpPR+LL6uWKK3KMwMCAS74QB3Um1uw==} - caniuse-lite@1.0.30001692: - resolution: {integrity: sha512-A95VKan0kdtrsnMubMKxEKUKImOPSuCpYgxSQBo036P5YYgVIcOYJEgt/txJWqObiRQeISNCfef9nvlQ0vbV7A==} + caniuse-lite@1.0.30001695: + resolution: {integrity: sha512-vHyLade6wTgI2u1ec3WQBxv+2BrTERV28UXQu9LO6lZ9pYeMk34vjXFLOxo1A4UBA8XTL4njRQZdno/yYaSmWw==} ccount@2.0.1: resolution: {integrity: sha512-eyrF0jiFpY+3drT6383f1qhkbGsLSifNAjA61IUjZjmLCWjItY6LB9ft9YhoDgwfmclB2zhu51Lc7+95b8NRAg==} @@ -5245,8 +5248,8 @@ packages: resolution: {integrity: sha512-nWJ91DjeOkej/TA8pXQ3myruKpKEYgqvpw9lz4OPHj/NWFNluYrjbz9j01CJ8yKQd2g4jFoOkINCTW2I5LEEyw==} engines: {node: '>= 0.4'} - unconfig@0.6.0: - resolution: {integrity: sha512-4C67J0nIF2QwSXty2kW3zZx1pMZ3iXabylvJWWgHybWVUcMf9pxwsngoQt0gC+AVstRywFqrRBp3qOXJayhpOw==} + unconfig@0.6.1: + resolution: {integrity: sha512-cVU+/sPloZqOyJEAfNwnQSFCzFrZm85vcVkryH7lnlB/PiTycUkAjt5Ds79cfIshGOZ+M5v3PBDnKgpmlE5DtA==} uncrypto@0.1.3: resolution: {integrity: sha512-Ql87qFHB3s/De2ClA9e0gsnS6zXG27SkTiSJwjCc9MebbfapQfuPzumMIUMi38ezPZVNFcHI9sUIepeQfw8J8Q==} @@ -5800,6 +5803,8 @@ snapshots: '@antfu/utils@0.7.10': {} + '@antfu/utils@8.1.0': {} + '@astrojs/check@0.9.4(typescript@5.7.3)': dependencies: '@astrojs/language-server': 2.15.4(typescript@5.7.3) @@ -7594,7 +7599,7 @@ snapshots: '@unocss/config@65.4.2': dependencies: '@unocss/core': 65.4.2 - unconfig: 0.6.0 + unconfig: 0.6.1 transitivePeerDependencies: - supports-color @@ -8104,7 +8109,7 @@ snapshots: autoprefixer@10.4.20(postcss@8.5.1): dependencies: browserslist: 4.24.4 - caniuse-lite: 1.0.30001692 + caniuse-lite: 1.0.30001695 fraction.js: 4.3.7 normalize-range: 0.1.2 picocolors: 1.1.1 @@ -8194,7 +8199,7 @@ snapshots: browserslist@4.24.4: dependencies: - caniuse-lite: 1.0.30001692 + caniuse-lite: 1.0.30001695 electron-to-chromium: 1.5.83 node-releases: 2.0.19 update-browserslist-db: 1.1.2(browserslist@4.24.4) @@ -8241,11 +8246,11 @@ snapshots: caniuse-api@3.0.0: dependencies: browserslist: 4.24.4 - caniuse-lite: 1.0.30001692 + caniuse-lite: 1.0.30001695 lodash.memoize: 4.1.2 lodash.uniq: 4.5.0 - caniuse-lite@1.0.30001692: {} + caniuse-lite@1.0.30001695: {} ccount@2.0.1: {} @@ -12130,9 +12135,9 @@ snapshots: has-symbols: 1.1.0 which-boxed-primitive: 1.1.1 - unconfig@0.6.0: + unconfig@0.6.1: dependencies: - '@antfu/utils': 0.7.10 + '@antfu/utils': 8.1.0 defu: 6.1.4 importx: 0.5.1 transitivePeerDependencies: diff --git a/src/layouts/Layout.astro b/src/layouts/Layout.astro index f691f26..26f9e24 100644 --- a/src/layouts/Layout.astro +++ b/src/layouts/Layout.astro @@ -8,6 +8,8 @@ import '@/styles/global.css' - +
+ +
diff --git a/src/styles/global.css b/src/styles/global.css index 4ab8f28..2d1b34e 100644 --- a/src/styles/global.css +++ b/src/styles/global.css @@ -12,3 +12,24 @@ body { h1, h2, h3 { text-rendering: optimizeLegibility; } +h1 { + --at-apply: 'text-[3.6rem]'; +} +h2 { + --at-apply: 'text-[3rem]'; +} +h3 { + --at-apply: 'text-[2.4rem]'; +} +h4 { + --at-apply: 'text-[2rem]'; +} +h5 { + --at-apply: 'text-[1.8rem]'; +} +h6 { + --at-apply: 'text-[1.6rem]'; +} +:where(p) { + --at-apply: 'text-primary/85'; +} diff --git a/uno.config.ts b/uno.config.ts index ebb1864..12be168 100644 --- a/uno.config.ts +++ b/uno.config.ts @@ -16,32 +16,11 @@ const { light, dark }: { dark: ThemeConfig['color']['dark'] } = themeConfig.color -const cssExtend = { - h1: { - 'font-size': '3.6rem', - }, - h2: { - 'font-size': '3rem', - }, - h3: { - 'font-size': '2.4rem', - }, - h4: { - 'font-size': '2rem', - }, - h5: { - 'font-size': '1.8rem', - }, - h6: { - 'font-size': '1.6rem', - }, -} - export default defineConfig({ presets: [ presetUno(), presetAttributify(), - presetTypography({ cssExtend }), + presetTypography(), presetTheme({ theme: { dark: {