---
title: "既存のテーマへの組み込み | Tajo"
description: "既存のプロジェクトに Tajo を組み込む方法を解説します"
url: https://tajo.io/jp/docs/getting-started/integrating/
markdown: https://tajo.io/jp/docs/getting-started/integrating.md
lang: ja-JP
author: "Set Noa"
author_url: https://tajo.io/jp/set-noa/
robots: noindex
---

先行利用を申し込む

お名前と会社のメールアドレスを入力してください。Tajoへのアクセス申請を確認するためのリンクをメールでお送りします。

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

[Set Noa](https://tajo.io/jp/set-noa/)

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

## 必要な手順

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

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

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

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

   ```css
   /* theme definition import */
   @import "./tailwind-theme.css";

   /* docs styles */
   @import "@/docs/styles/docs-global.css";
   ```

3. サイトのコンテンツコレクション設定ファイルに、ドキュメント用のコンテンツコレクションを追加します。

   ```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 の設定に追加します。

   ```ts
   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](https://fontsource.org/fonts/inter/install) からローカルにインストールすることを推奨します。

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

```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` コンポーネントでもフォントをプリロードしてください。

```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" />
```
