先行利用を申し込む

お名前とメールアドレスまたは電話番号をご入力ください。Tajo のアクセス方法をご案内します。

既存のテーマへの組み込み

このテーマは、ほかの Tailwind CSS v4 プロジェクトとシームレスに連携するよう設計されています。

必要な手順

  1. このテーマの src/docs フォルダーを既存のプロジェクトにコピーします。

    このテーマの大部分の要素は src/docs フォルダー配下にあります。最初のステップとして、このフォルダー全体を既存のプロジェクトにコピーしてください(src/docs という同じフォルダー構成を保ちます)。

  2. ドキュメント用のスタイルをグローバル CSS ファイルに読み込みます。

    global.css ファイルの Tailwind テーマのインポートの後に、次の行を追加します。

    src/styles/global.css
    /* theme definition import */
    @import "./tailwind-theme.css";
    /* docs styles */
    @import "@/docs/styles/docs-global.css";
  3. サイトのコンテンツコレクション設定ファイルに、ドキュメント用のコンテンツコレクションを追加します。

    src/content.config.ts
    // other collections...
    const docsCollection = defineCollection({
    loader: glob({ pattern: "**/[^_]*{md,mdx}", base: "./src/docs/data/docs" }),
    schema: () =>
    z.object({
    title: z.string(),
    description: z.string().optional(),
    sidebar: z
    .object({
    label: z.string().optional(),
    order: z.number().optional(),
    badge: z
    .object({
    text: z.string(),
    variant: z.enum(["note", "tip", "caution", "danger", "info"]).default("note"),
    })
    .optional(),
    })
    .optional(),
    tableOfContents: z
    .object({
    minHeadingLevel: z.number().min(1).max(6).optional(),
    maxHeadingLevel: z.number().min(1).max(6).optional(),
    })
    .optional(),
    pagefind: z.boolean().optional(),
    mappingKey: z.string().optional(),
    draft: z.boolean().optional(),
    }),
    });
    export const collections = {
    // other collection....
    docs: docsCollection,
    };
  4. MDX コンポーネントを AutoImport の設定に追加します。

    astro.config.mjs
    export default defineConfig({
    // other config options...
    integrations: [
    AutoImport({
    imports: [
    // other imports...
    "@/docs/components/mdx-components/Aside.astro",
    "@/docs/components/mdx-components/Badge.astro",
    "@/docs/components/mdx-components/Button.astro",
    "@/docs/components/mdx-components/Steps.astro",
    "@/docs/components/mdx-components/Tabs.astro",
    "@/docs/components/mdx-components/TabsContent.astro",
    "@/docs/components/mdx-components/TabsList.astro",
    "@/docs/components/mdx-components/TabsTrigger.astro",
    ],
    }),
    ],
    });
  5. ドキュメントページをサイトに追加します。

    Tajo テーマから src/pages/docs フォルダー全体を、サイトの src/pages/docs フォルダーにコピーします。

任意の手順

フォント

このテーマは既定で Inter フォントを使用します。フォントは fontsource からローカルにインストールすることを推奨します。

続いて、fonts.css ファイルに次の内容を追加します。

src/styles/fonts.css
/* inter-latin-wght-normal */
@font-face {
font-family: "Inter Variable";
font-style: normal;
font-display: swap;
font-weight: 100 900;
src: url(@fontsource-variable/inter/files/inter-latin-wght-normal.woff2)
format("woff2-variations");
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304,
U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF,
U+FFFD;
}

別のフォントを使う

ほかのフォントを使うこともできます。その場合は、必要なフォントを fonts.css ファイルに追加し、src/docs/styles/docs-global.css ファイルの font-family プロパティを更新してください。

Info

Inter フォントと同様に、src/docs/layouts/BaseHead.astro コンポーネントでもフォントをプリロードしてください。

---
import InterVariable from "@fontsource-variable/inter/files/inter-latin-wght-normal.woff2";
---
<link rel="preload" href={InterVariable} as="font" type="font/woff2" crossorigin="anonymous" />

先行利用を申し込む

お名前とメールアドレスまたは電話番号をご入力ください。Tajo のアクセス方法をご案内します。

自動判定
AIアシスタント

こんにちは!ドキュメントについて何でもお聞きください。