Shadcn Customizationのロゴ

Shadcn Customization

組織人気
marmelab
shadcn-customization

Shadcn/uiのテーマ設定とコンポーネントのカスタマイズ(CSS変数、OKLCHカラー、ダークモード、バリアント、ラッパー)。色、テーマ、UIレイアウト、コンポーネントのスタイル設定に関するチケットで読み込みます。

Add to TypingMind

概要

公開者marmelab
リポジトリatomic-crm
スキル名shadcn-customization
スター
1.4K
フォーク
860
同梱ファイル
指示のみ
ライセンスMIT
リンク
  • Markdown形式の指示

    モデルが必要に応じて読み込むSKILL.mdファイルです。関連するリクエストがあったときだけトークンを消費します。

  • どのLLMでも利用可能

    AIスキルはプロバイダー固有のコードではなく、通常のMarkdownなので、GPT、Claude、Gemini、Grok、ローカルモデルで利用できます。

  • 指示だけで完結

    モデルに必要なものはすべて指示に含まれているため、別途同期するファイルはありません。

  • オープンソース

    marmelabがGitHubで公開しています。インストールする前にソースを確認してください。

インストール

AIスキル「Shadcn Customization」をTypingMindにインストールすれば、どのLLMでも利用できます。SKILL.mdを読み取れる別のAIエージェントに追加することもできます。

1

TypingMindにインストール

TypingMindはGitHubフォルダから直接スキルをインストールします。SKILL.mdを読み取り、リソースファイルをまとめてローカルに保存します。

  1. アプリを開き、「プラグイン」→「スキル」に移動します。
  2. 「GitHubからインストール」を選択します。
  3. 以下のスキルフォルダのURLを貼り付けて確定します。
    https://github.com/marmelab/atomic-crm/tree/main/.claude/skills/shadcn-customization
  4. スキルを利用したいチャットごとに、そのスキルを有効にしてください。
「プラグイン」→「スキル」→「スキルを追加」→「GitHubのURLから」を選択し、フォルダのURLを貼り付けて「続行」を押します。
2

別のAIエージェントにインストール

Agent Skills形式を読み取れるAIエージェントなら、このスキルを利用できます。フォルダをそのAIエージェントのスキルディレクトリにコピーしてください。

Claude Code — .claude/skills
git clone --depth 1 https://github.com/marmelab/atomic-crm.git /tmp/atomic-crm
mkdir -p .claude/skills
cp -r /tmp/atomic-crm/.claude/skills/shadcn-customization .claude/skills/shadcn-customization
コピー後、新しいスキルを読み込むためにClaude Codeを再起動してください。

TypingMindで使用

TypingMindのチャットでShadcn Customizationを有効にするだけで、あとはモデルが対応します。名前と説明がシステムプロンプトに含まれ、関連するリクエストがあると、モデルが指示の全文を自動で読み込みます。手動で呼び出す必要はなく、実際に使用されるまでトークンを消費しません。

関連するリクエストがあるとすぐに、モデルが自動的にShadcn Customizationを読み込みます。

どのAIモデルでも利用可能

AIスキルはプロバイダー固有のコードではなく、通常のMarkdownで書かれた指示です。そのため、Shadcn Customizationは作成時に想定されたモデルに縛られません。TypingMindに一度インストールすれば、ご自身のAPIキーを使って、GPT-5、Claude、Gemini、Grok、DeepSeek、Mistral、Llama、またはご自身で実行するローカルモデルで利用できます。

  • 必要なときだけ読み込み

    システムプロンプトには名前と説明だけが含まれます。関連するリクエストが初めてあったときに指示を取得するため、スキルを使わない間は指示の読み込みにトークンを消費しません。

  • チャットの途中でモデルを切り替え

    スキルはコードではなく指示なので、モデルを切り替えてもそのまま使えます。次のモデルも同じSKILL.mdを読み込みます。

スキルの指示

モデルが読み込むSKILL.mdの内容です。スキルはモデルが従う指示なので、インストールする前に確認してください。

Customization & Theming

Reference for theming and component customization. Components reference semantic CSS variable tokens change the variables to change every component. Read the relevant section, then check the Red Flags and Verification list.

When to Use

  • Changing colors, theme, dark mode, or border radius.
  • Adding a custom color token or a new component variant.
  • Customizing or wrapping a shadcn/ui component.

For component architecture and where to import from, see Skill({skill: "frontend-dev"}).


How It Works

  1. CSS variables defined in :root (light) and .dark (dark mode).
  2. Tailwind maps them to utilities: bg-primary, text-muted-foreground, etc.
  3. Components use these utilities — changing a variable changes all components that reference it.

Color Variables

Every color follows the name / name-foreground convention. The base variable is for backgrounds, -foreground is for text/icons on that background.

VariablePurpose
--background / --foregroundPage background and default text
--card / --card-foregroundCard surfaces
--primary / --primary-foregroundPrimary buttons and actions
--secondary / --secondary-foregroundSecondary actions
--muted / --muted-foregroundMuted/disabled states
--accent / --accent-foregroundHover and accent states
--destructive / --destructive-foregroundError and destructive actions
--borderDefault border color
--inputForm input borders
--ringFocus ring color
--chart-1 through --chart-5Chart/data visualization
--sidebar-*Sidebar-specific colors
--surface / --surface-foregroundSecondary surface

Colors use OKLCH: --primary: oklch(0.205 0 0) where values are lightness (0–1), chroma (0 = gray), and hue (0–360).


Dark Mode

Class-based toggle via .dark on the root element. Atomic CRM wires this through its own ThemeProvider at src/components/admin/theme-provider.tsx, which is already mounted from src/components/admin/admin.tsx. To customize the palette, pass lightTheme / darkTheme props to the <CRM> component (see src/App.tsx).


Changing the Theme

bash
# Apply a preset from ui.shadcn.com.
npx shadcn@latest apply --preset a2r6bw

# Positional shorthand also works.
npx shadcn@latest apply a2r6bw

# Switch to a named preset, overwrite existing components.
npx shadcn@latest apply --preset nova

# Preserve existing components instead.
npx shadcn@latest init --preset nova --force --no-reinstall

# Use a custom theme URL.
npx shadcn@latest apply --preset "https://ui.shadcn.com/init?base=radix&style=nova&theme=blue&..."

Or edit CSS variables directly in globals.css.


Adding Custom Colors

Add variables to the file at tailwindCssFile from npx shadcn@latest info (typically globals.css). Never create a new CSS file for this.

css
/* 1. Define in the global CSS file. */
:root {
  --warning: oklch(0.84 0.16 84);
  --warning-foreground: oklch(0.28 0.07 46);
}
.dark {
  --warning: oklch(0.41 0.11 46);
  --warning-foreground: oklch(0.99 0.02 95);
}
css
/* 2. Register with Tailwind v4 (@theme inline). */
@theme inline {
  --color-warning: var(--warning);
  --color-warning-foreground: var(--warning-foreground);
}
tsx
// 3. Use in components.
<div className="bg-warning text-warning-foreground">Warning</div>

Border Radius

--radius controls border radius globally. Components derive values from it (rounded-lg = var(--radius), rounded-md = calc(var(--radius) - 2px)).


Customizing Components

Prefer these approaches in order:

1. Built-in variants

tsx
<Button variant="outline" size="sm">Click</Button>

2. Tailwind classes via className

tsx
<Card className="mx-auto max-w-md">...</Card>

3. Add a new variant

Edit the component source to add a variant via cva:

tsx
// components/ui/button.tsx
warning: "bg-warning text-warning-foreground hover:bg-warning/90",

4. Wrapper components

Compose shadcn/ui primitives into higher-level components:

tsx
export function ConfirmDialog({ title, description, onConfirm, children }) {
  return (
    <AlertDialog>
      <AlertDialogTrigger asChild>{children}</AlertDialogTrigger>
      <AlertDialogContent>
        <AlertDialogHeader>
          <AlertDialogTitle>{title}</AlertDialogTitle>
          <AlertDialogDescription>{description}</AlertDialogDescription>
        </AlertDialogHeader>
        <AlertDialogFooter>
          <AlertDialogCancel>Cancel</AlertDialogCancel>
          <AlertDialogAction onClick={onConfirm}>Confirm</AlertDialogAction>
        </AlertDialogFooter>
      </AlertDialogContent>
    </AlertDialog>
  )
}

Checking for Updates

bash
npx shadcn@latest add button --diff
npx shadcn@latest add button --dry-run        # see all affected files
npx shadcn@latest add button --diff button.tsx # diff for a specific file

Red Flags

  • A hardcoded hex/rgb color in a component instead of a semantic token (bg-primary, text-muted-foreground).
  • A new CSS file created for custom colors instead of adding them to the global CSS file.
  • A custom color used without registering it under @theme inline for Tailwind v4.
  • Editing component source for a one-off when a variant or className would do.
  • Palette changes wired anywhere but the lightTheme/darkTheme props on <CRM>.
  • A token defined in :root but not in .dark (or vice versa) — one mode is left broken.

Verification

  • Colors use semantic tokens, never hardcoded values.
  • Custom colors live in the global CSS file and are registered under @theme inline.
  • Every new token is defined in both :root and .dark.
  • Customization uses the lowest-effort approach that works (variant → className → new variant → wrapper).
  • Palette changes go through lightTheme/darkTheme on <CRM>.

よくある質問

AIスキル「Shadcn Customization」では何ができますか?

Shadcn/uiのテーマ設定とコンポーネントのカスタマイズ(CSS変数、OKLCHカラー、ダークモード、バリアント、ラッパー)。色、テーマ、UIレイアウト、コンポーネントのスタイル設定に関するチケットで読み込みます。

TypingMindでShadcn Customizationを使うメリットは何ですか?

一度インストールすれば、どのモデルでも使えるからです。Shadcn Customizationはプロバイダー固有のコードではなく、通常のMarkdownで記述されているため、同じスキルをGPT-5、Claude、Gemini、Grok、ローカルモデルで利用できます。チャットの途中でモデルを切り替えても、そのまま使い続けられます。TypingMindは自分のAPIキーで動作するため、シート単位のサブスクリプションではなく、プロバイダーに直接料金を支払います。スキルとチャットは自分のストレージに保持されます。

TypingMindにShadcn Customizationをインストールするにはどうすればよいですか?

TypingMindで「プラグイン」→「スキル」→「GitHubからインストール」を開き、https://github.com/marmelab/atomic-crm/tree/main/.claude/skills/shadcn-customizationを貼り付けてください。TypingMindがSKILL.mdを読み込み、チャットごとに有効にできるスキルとしてインストールします。

Shadcn Customizationを使えるAIモデルはどれですか?

TypingMindに接続したどのモデルでも利用できます。AIスキルはプロバイダー固有のコードではなく、通常のMarkdownで書かれた指示です。そのため、GPT、Claude、Gemini、Grok、ローカルモデルのいずれも、リクエストの内容がこのスキルの用途に合ったときに、このスキルを読み込めます。

Shadcn Customizationで使えるAIモデルの数に制限はありますか?

数に制限はありません。スキルに対応したモデルであれば、GPT、Claude、Gemini、Grok、DeepSeek、Mistral、Llamaなど、どのモデルでもShadcn Customizationを利用できます。すべてTypingMind上で、自分のAPIキーを使って利用できます。

AIスキル「Shadcn Customization」は無料ですか?

はい。marmelabがMITライセンスのもとでGitHubに公開しています。ご利用のAIプロバイダーに支払うのは、使用したトークンの料金だけです。

AIスキルとは何ですか?

AIスキルは、特定のタスクの実行方法をAIモデルに教える、再利用可能な指示のセットです。オープンなAgent Skills形式に従い、名前と説明を含むSKILL.mdファイルに加え、モデルが必要とするスクリプト、テンプレート、参照ファイルで構成されます。モデルはリクエストがスキルに合致したときだけ指示を読み込むため、インストール済みのスキルも、使うまでは費用がかかりません。

AIスキルは、プラグインやMCPサーバーとどう違いますか?

プラグインやMCPサーバーは、モデルが呼び出せる新しいツールを提供します。ツールとは、どこかで実行され、結果を返すコードです。一方、AIスキルは、タスクへの取り組み方、従うべき手順、望ましい出力の例といった知識や進め方をモデルに伝えます。スキルは通常のMarkdownで記述されているため、サーバー、APIキー、実行環境は不要で、どのモデルでも利用できます。

すべて見る

今すぐ自分専用のAIワークスペースを作成

ニュースレターに登録すると、新機能や今後のプレゼント企画のお知らせが届きます👇