From e3089167ca4a387cf40f42291b70a7d254cbf149 Mon Sep 17 00:00:00 2001 From: huyikai Date: Fri, 16 Feb 2024 17:44:20 +0800 Subject: [PATCH 1/3] i18n(zh-ch): Update `fonts.mdx` --- src/content/docs/zh-cn/guides/fonts.mdx | 31 +++++++++++++------------ 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/src/content/docs/zh-cn/guides/fonts.mdx b/src/content/docs/zh-cn/guides/fonts.mdx index eb28d4807b48a..327927ceb1532 100644 --- a/src/content/docs/zh-cn/guides/fonts.mdx +++ b/src/content/docs/zh-cn/guides/fonts.mdx @@ -99,24 +99,25 @@ import PackageManagerTabs from '~/components/tabs/PackageManagerTabs.astro'; 要在 Tailwind 中注册你的字体: 1. 请遵循上述任一指南,但跳过添加 `font-family` 到 CSS 的最后一步。 -1. 将字体名称添加到 `tailwind.config.cjs`。 +1. 将字体名称添加到 `tailwind.config.mjs`。 此示例将添加 `InterVariable` 和 `Inter` 到 sans-serif 字体堆栈,并使用 Tailwind CSS 的默认备用字体。 - ```js title="tailwind.config.cjs" ins={1,7-9} - const defaultTheme = require("tailwindcss/defaultTheme"); - - module.exports = { - // ... - theme: { - extend: { - fontFamily: { - sans: ["InterVariable", "Inter", ...defaultTheme.fontFamily.sans], - }, - }, - }, - // ... - }; + ```js title="tailwind.config.mjs" ins={1,8-10} + import defaultTheme from 'tailwindcss/defaultTheme' + + /** @type {import('tailwindcss').Config} */ + export default { + content: ['./src/**/*.{astro,html,js,jsx,md,mdx,svelte,ts,tsx,vue}'], + theme: { + extend: { + fontFamily: { + sans: ['Inter', ...defaultTheme.fontFamily.sans], + }, + }, + }, + plugins: [], + } ``` 现在,项目中的所有 sans-serif 文本(Tailwind 的默认设置)都将使用你选择的字体,并且该类 `font-sans` 也将应用 Inter 字体。 From f3cccf083da626213b18042ef1d0e56a34d71f0d Mon Sep 17 00:00:00 2001 From: huyikai Date: Fri, 16 Feb 2024 18:28:47 +0800 Subject: [PATCH 2/3] i18n(zh-cn): Update `fonts.mdx` --- src/content/docs/zh-cn/guides/fonts.mdx | 31 ++++++++++++------------- 1 file changed, 15 insertions(+), 16 deletions(-) diff --git a/src/content/docs/zh-cn/guides/fonts.mdx b/src/content/docs/zh-cn/guides/fonts.mdx index 327927ceb1532..eb28d4807b48a 100644 --- a/src/content/docs/zh-cn/guides/fonts.mdx +++ b/src/content/docs/zh-cn/guides/fonts.mdx @@ -99,25 +99,24 @@ import PackageManagerTabs from '~/components/tabs/PackageManagerTabs.astro'; 要在 Tailwind 中注册你的字体: 1. 请遵循上述任一指南,但跳过添加 `font-family` 到 CSS 的最后一步。 -1. 将字体名称添加到 `tailwind.config.mjs`。 +1. 将字体名称添加到 `tailwind.config.cjs`。 此示例将添加 `InterVariable` 和 `Inter` 到 sans-serif 字体堆栈,并使用 Tailwind CSS 的默认备用字体。 - ```js title="tailwind.config.mjs" ins={1,8-10} - import defaultTheme from 'tailwindcss/defaultTheme' - - /** @type {import('tailwindcss').Config} */ - export default { - content: ['./src/**/*.{astro,html,js,jsx,md,mdx,svelte,ts,tsx,vue}'], - theme: { - extend: { - fontFamily: { - sans: ['Inter', ...defaultTheme.fontFamily.sans], - }, - }, - }, - plugins: [], - } + ```js title="tailwind.config.cjs" ins={1,7-9} + const defaultTheme = require("tailwindcss/defaultTheme"); + + module.exports = { + // ... + theme: { + extend: { + fontFamily: { + sans: ["InterVariable", "Inter", ...defaultTheme.fontFamily.sans], + }, + }, + }, + // ... + }; ``` 现在,项目中的所有 sans-serif 文本(Tailwind 的默认设置)都将使用你选择的字体,并且该类 `font-sans` 也将应用 Inter 字体。 From daf1049818b40bbfdd33815848db1a4de63878ae Mon Sep 17 00:00:00 2001 From: huyikai Date: Tue, 12 Mar 2024 09:39:40 +0800 Subject: [PATCH 3/3] 20240312: Update `locals-not-an-object.mdx` --- .../docs/zh-cn/reference/errors/locals-not-an-object.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/content/docs/zh-cn/reference/errors/locals-not-an-object.mdx b/src/content/docs/zh-cn/reference/errors/locals-not-an-object.mdx index 3dcf30c68628e..e592fbfaac726 100644 --- a/src/content/docs/zh-cn/reference/errors/locals-not-an-object.mdx +++ b/src/content/docs/zh-cn/reference/errors/locals-not-an-object.mdx @@ -8,7 +8,7 @@ githubURL: https://github.com/withastro/astro/blob/main/packages/astro/src/core/ ## 哪里发生了错误? -在开发模式下,当 `locals` 被赋值为一个非对象时抛出错误。 +当 `locals` 被赋值为一个非对象时抛出错误。 例如: