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 4fafa446a25ddc323d227aea6625c6693d114274 Mon Sep 17 00:00:00 2001 From: huyikai Date: Tue, 12 Mar 2024 08:31:12 +0800 Subject: [PATCH 3/3] 20240312: Update `markdown-content.mdx` --- src/content/docs/zh-cn/guides/markdown-content.mdx | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/content/docs/zh-cn/guides/markdown-content.mdx b/src/content/docs/zh-cn/guides/markdown-content.mdx index 6a2cbb7fb0539..84746fb54d910 100644 --- a/src/content/docs/zh-cn/guides/markdown-content.mdx +++ b/src/content/docs/zh-cn/guides/markdown-content.mdx @@ -569,7 +569,7 @@ export default defineConfig({ ### 语法高亮 -Astro 内置支持 [Shiki](https://shiki.matsu.io/) (通过 [Shikiji](https://github.com/shikijs/shiki)) 和 [Prism](https://prismjs.com/)。这为: +Astro 内置支持 [Shiki](https://shiki.style/) 和 [Prism](https://prismjs.com/)。这为: - Markdown 或 MDX 文件中的所有代码块(\`\`\`)。 - [内置的 `` 组件](/zh-cn/reference/api-reference/#code-) 中的内容(由 Shiki 提供支持)。 @@ -588,17 +588,17 @@ export default defineConfig({ markdown: { shikiConfig: { // 选择 Shiki 内置的主题(或添加你自己的主题) - // https://github.com/shikijs/shiki/blob/main/docs/themes.md + // https://shiki.style/themes theme: 'dracula', // 另外,也提供了多种主题 - // https://shiki.style/guide/dual-themes#light-dark-dual-themes - experimentalThemes: { + // https://shiki.style/guide/dual-themes + themes: { light: 'github-light', dark: 'github-dark', }, // 添加自定义语言 // 注意:Shiki 内置了无数语言,包括 .astro! - // https://github.com/shikijs/shiki/blob/main/docs/languages.md + // https://shiki.style/languages langs: [], // 启用自动换行,以防止水平滚动 wrap: true, @@ -625,7 +625,7 @@ export default defineConfig({ }); ``` -我们还建议阅读 [Shiki 的主题文档](https://github.com/shikijs/shiki/blob/main/docs/themes.md#loading-theme),以了解更多关于主题、深色模式切换或通过 CSS 变量进行样式设置的内容。 +我们还建议阅读 [Shiki 的主题文档](https://shiki.style/themes),以了解更多关于主题、深色模式切换或通过 CSS 变量进行样式设置的内容。 #### 改变默认语法高亮模式