jpskill.com
🎨 デザイン コミュニティ

tailwind

HyperFramesでTailwind CSSを利用する際に、HTMLでのユーティリティクラス記述、CSSテーマトークンの追加、v3とv4の構文比較、ブラウザランタイムかCSSコンパイルかの判断を支援し、Tailwind CSSの効率的な利用を促進するSkill。

📜 元の英語説明(参考)

Tailwind CSS v4.2 browser-runtime patterns for HyperFrames compositions. Use when scaffolding or editing projects created with `hyperframes init --tailwind`, writing Tailwind utility classes in composition HTML, adding CSS-first Tailwind v4 theme tokens, debugging v3 vs v4 syntax, or deciding when to compile Tailwind to CSS instead of using the browser runtime.

🇯🇵 日本人クリエイター向け解説

一言でいうと

HyperFramesでTailwind CSSを利用する際に、HTMLでのユーティリティクラス記述、CSSテーマトークンの追加、v3とv4の構文比較、ブラウザランタイムかCSSコンパイルかの判断を支援し、Tailwind CSSの効率的な利用を促進するSkill。

※ jpskill.com 編集部が日本のビジネス現場向けに補足した解説です。Skill本体の挙動とは独立した参考情報です。

⚡ おすすめ: コマンド1行でインストール(60秒)

下記のコマンドをコピーしてターミナル(Mac/Linux)または PowerShell(Windows)に貼り付けてください。 ダウンロード → 解凍 → 配置まで全自動。

🍎 Mac / 🐧 Linux
mkdir -p ~/.claude/skills && cd ~/.claude/skills && curl -L -o tailwind.zip https://jpskill.com/download/19206.zip && unzip -o tailwind.zip && rm tailwind.zip
🪟 Windows (PowerShell)
$d = "$env:USERPROFILE\.claude\skills"; ni -Force -ItemType Directory $d | Out-Null; iwr https://jpskill.com/download/19206.zip -OutFile "$d\tailwind.zip"; Expand-Archive "$d\tailwind.zip" -DestinationPath $d -Force; ri "$d\tailwind.zip"

完了後、Claude Code を再起動 → 普通に「動画プロンプト作って」のように話しかけるだけで自動発動します。

💾 手動でダウンロードしたい(コマンドが難しい人向け)
  1. 1. 下の青いボタンを押して tailwind.zip をダウンロード
  2. 2. ZIPファイルをダブルクリックで解凍 → tailwind フォルダができる
  3. 3. そのフォルダを C:\Users\あなたの名前\.claude\skills\(Win)または ~/.claude/skills/(Mac)へ移動
  4. 4. Claude Code を再起動

⚠️ ダウンロード・利用は自己責任でお願いします。当サイトは内容・動作・安全性について責任を負いません。

🎯 このSkillでできること

下記の説明文を読むと、このSkillがあなたに何をしてくれるかが分かります。Claudeにこの分野の依頼をすると、自動で発動します。

📦 インストール方法 (3ステップ)

  1. 1. 上の「ダウンロード」ボタンを押して .skill ファイルを取得
  2. 2. ファイル名の拡張子を .skill から .zip に変えて展開(macは自動展開可)
  3. 3. 展開してできたフォルダを、ホームフォルダの .claude/skills/ に置く
    • · macOS / Linux: ~/.claude/skills/
    • · Windows: %USERPROFILE%\.claude\skills\

Claude Code を再起動すれば完了。「このSkillを使って…」と話しかけなくても、関連する依頼で自動的に呼び出されます。

詳しい使い方ガイドを見る →
最終更新
2026-05-18
取得日時
2026-05-18
同梱ファイル
1

📖 Skill本文(日本語訳)

※ 原文(英語/中国語)を Gemini で日本語化したものです。Claude 自身は原文を読みます。誤訳がある場合は原文をご確認ください。

HyperFrames 用 Tailwind CSS

HyperFrames の init --tailwind は、@tailwindcss/browser@4.2.4 に固定された Tailwind ブラウザランタイムを使用します。これは Tailwind v4 として扱われ、v3 ではありません。

このスキルは、CLI によって生成された HTML を構成するためのものです。packages/studio 用ではありません。packages/studio は、引き続き tailwind.config.js、PostCSS、および @tailwind ディレクティブを使用して内部的に Tailwind v3 を使用しています。

使用する場面

  • ユーザーが HyperFrames の構成で Tailwind を要求した場合。
  • プロジェクトが hyperframes init --tailwind で作成された場合。
  • index.htmlwindow.__tailwindReady がある場合。
  • ユーティリティクラス、CSS ファーストのテーマトークン、カスタムユーティリティ、または v3 から v4 への移行ガイダンスが必要な場合。
  • レンダリングでスタイルが欠落しており、プロジェクトがブラウザランタイムに依存している場合。

バージョン契約

  • 固定されたランタイム: @tailwindcss/browser@4.2.4
  • ブラウザランタイムスクリプトは CLI によって注入されます。cdn.tailwindcss.com に置き換えないでください。
  • HyperFrames は、フレームキャプチャが開始される前に window.__tailwindReady を待ちます。
  • レディネスシムは決定論的でなければなりません。レンダーループポーリング API、クロックベースのリトライ、固定された Tailwind ランタイムスクリプト以外のランタイムネットワークフェッチは使用しません。
  • オフライン、ロックダウン、または本番環境で安定したレンダリングの場合、Tailwind を CSS にコンパイルし、ブラウザランタイムに依存する代わりにスタイルシートを直接含めてください。

v4 のルール

Tailwind v4 は CSS ファーストです。

<style type="text/tailwindcss">
  @theme {
    --color-brand: oklch(0.68 0.2 252);
    --font-display: "Inter", sans-serif;
  }

  @utility headline-balance {
    text-wrap: balance;
    letter-spacing: 0;
  }
</style>

ブラウザランタイムの構成では、v3 のセットアップパターンを避けてください。

/* Tailwind v4 ブラウザランタイムの構成ではこれらを使用しないでください。 */
@tailwind base;
@tailwind components;
@tailwind utilities;

v4 ブラウザランタイムの構成で色、フォント、間隔、またはユーティリティを定義するためだけに tailwind.config.js を追加しないでください。text/tailwindcss スタイルブロックで @theme@utility を使用してください。

コンパイルされた v4 ビルドのために既存の JavaScript 設定が本当に必要な場合は、CSS から @config で明示的にロードし、ブラウザで検証してください。v4 が v3 設定ファイルを自動検出すると仮定しないでください。

HyperFrames 構成パターン

Tailwind は静的なレイアウトと視覚スタイルを担当させます。モーションのタイミングは GSAP または別のシーク可能なアダプターに任せます。

<section
  class="clip absolute inset-0 grid place-items-center bg-zinc-950 text-white"
  data-start="0"
  data-duration="5"
  data-track-index="1"
>
  <div class="w-[1280px] max-w-[82vw] text-center">
    <p class="mb-6 text-xl font-medium uppercase tracking-[0.18em] text-cyan-300">
      Render-ready Tailwind
    </p>
    <h1 class="text-7xl font-black leading-none text-balance">
      Utility classes, deterministic frames.
    </h1>
  </div>
</section>

繰り返し要素の場合、クラス名を動的に生成するよりも、クラスリストと CSS カスタムプロパティを優先してください。

<span class="inline-block translate-y-[calc(var(--i)*6px)] opacity-80" style="--i: 0"></span>
<span class="inline-block translate-y-[calc(var(--i)*6px)] opacity-80" style="--i: 1"></span>
<span class="inline-block translate-y-[calc(var(--i)*6px)] opacity-80" style="--i: 2"></span>

動的クラスの安全性

Tailwind のブラウザランタイムは現在のドキュメントをスキャンし、認識できるクラス名に対して CSS を生成します。シーク時にのみレンダリングに不可欠なクラス名を構築しないでください。

// 危険: Tailwind はキャプチャ前に生成されたすべてのクラスを認識できない可能性があります。
element.className = `bg-${color}-500`;

代わりに、HTML、データ属性、または明示的な CSS で完全なクラス名を使用してください。

<div data-tone="blue" class="bg-blue-500 data-[tone=rose]:bg-rose-500"></div>

生成されたクラスが避けられない場合は、検証前に text/tailwindcss ブロックに完全なクラスのトークンが表示されていることを確認してください。

ビデオ固有のガードレール

  • 安定した寸法を使用してください: w-[...]h-[...]aspect-videogridflex、およびビデオレイアウト用の固定パディング。
  • アニメーションプロパティには transform と opacity を優先してください。
  • シーク可能なランタイムが状態を所有している場合を除き、Tailwind のトランジションをレンダリングに不可欠なタイミングから外してください。
  • 決定論的にレンダリングする必要があるコンテンツには、hover、focus、scroll、viewport、または pointer バリアントを避けてください。
  • 明示的なボーダーカラーを使用してください。Tailwind v4 は v3 からデフォルトのボーダー動作を変更したため、border border-white/20 は裸の border よりも安全です。
  • v4 のユーティリティ名を使用してください: shadow-xsrounded-xsoutline-hiddenshrink-*、および grow-* (これらの置き換えが適用される場合)。
  • 出力が古いブラウザのサポートを必要とする場合、最新の CSS ユーティリティには注意してください。Tailwind v4 は最新のブラウザをターゲットにしています。

検証

Tailwind が有効な構成を編集した後:

npx hyperframes lint
npx hyperframes validate
npx hyperframes inspect

レンダリングプルーフの場合:

npx hyperframes render . --workers 1 --quality draft --output tailwind-proof.mp4

検証パスでは、フレーム 0 でスタイルが欠落しているフラッシュが表示されないはずです。プレビューではスタイルが表示されるのにレンダリングされない場合は、window.__tailwindReady が存在し、キャプチャ前に解決されていることを確認してください。

クイックデバッグチェックリスト

  1. プロジェクトが hyperframes init --tailwind でスキャフォールドされたことを確認してください。
  2. スクリプトが @tailwindcss/browser@4.2.4 を指していることを確認してください。
  3. window.__tailwindReady が存在することを確認してください。
  4. v3 の @tailwind ディレクティブを v4 ブラウザランタイムの CSS に置き換えてください。
  5. カスタムトークンを tailwind.config.js から @theme に移動してください。
  6. 動的に組み立てられたクラスを完全な静的トークンに置き換えてください。
  7. npx hyperframes validate を実行し、短いプルーフをレンダリングしてください。

クレジットと参考文献

  • Tailwind CSS 公式 v4 のインストール、アップグレード、および互換性に関するドキュメント: https://tailwindcss.com/docs
  • Tailwind CSS v4 リリースノート: https://tailwindcss.com/blog/tailwindcss-v4
  • コミュニティの Tailwind スキルは v4 の落とし穴とスキルの形状についてレビューされましたが、このスキルは永続的な契約をリポジトリ内および HyperFrames 固有に保っています。
📜 原文 SKILL.md(Claudeが読む英語/中国語)を展開

Tailwind CSS for HyperFrames

HyperFrames init --tailwind uses the Tailwind browser runtime pinned to @tailwindcss/browser@4.2.4. Treat that as Tailwind v4, not v3.

This skill is for composition HTML generated by the CLI. It is not for packages/studio, which still uses Tailwind v3 internally with tailwind.config.js, PostCSS, and @tailwind directives.

When To Use

  • The user asks for Tailwind in a HyperFrames composition.
  • A project was created with hyperframes init --tailwind.
  • You see window.__tailwindReady in index.html.
  • You need utility classes, CSS-first theme tokens, custom utilities, or v3-to-v4 migration guidance.
  • The render has missing styles and the project is relying on the browser runtime.

Version Contract

  • Pinned runtime: @tailwindcss/browser@4.2.4.
  • Browser runtime script is injected by the CLI. Do not replace it with cdn.tailwindcss.com.
  • HyperFrames waits for window.__tailwindReady before frame capture starts.
  • The readiness shim must stay deterministic: no render-loop polling APIs, no clock-based retries, no runtime network fetches beyond the pinned Tailwind runtime script.
  • For offline, locked-down, or production-stable renders, compile Tailwind to CSS and include the stylesheet directly instead of relying on the browser runtime.

v4 Rules

Tailwind v4 is CSS-first:

<style type="text/tailwindcss">
  @theme {
    --color-brand: oklch(0.68 0.2 252);
    --font-display: "Inter", sans-serif;
  }

  @utility headline-balance {
    text-wrap: balance;
    letter-spacing: 0;
  }
</style>

Avoid v3 setup patterns in browser-runtime compositions:

/* Do not use these in Tailwind v4 browser-runtime compositions. */
@tailwind base;
@tailwind components;
@tailwind utilities;

Do not add a tailwind.config.js just to define colors, fonts, spacing, or utilities for a v4 browser-runtime composition. Use @theme and @utility in a text/tailwindcss style block.

If you truly need an existing JavaScript config for a compiled v4 build, load it explicitly from CSS with @config, then validate in the browser. Do not assume v4 auto-detects v3 config files.

HyperFrames Composition Pattern

Keep Tailwind responsible for static layout and visual style. Keep motion timing in GSAP or another seekable adapter.

<section
  class="clip absolute inset-0 grid place-items-center bg-zinc-950 text-white"
  data-start="0"
  data-duration="5"
  data-track-index="1"
>
  <div class="w-[1280px] max-w-[82vw] text-center">
    <p class="mb-6 text-xl font-medium uppercase tracking-[0.18em] text-cyan-300">
      Render-ready Tailwind
    </p>
    <h1 class="text-7xl font-black leading-none text-balance">
      Utility classes, deterministic frames.
    </h1>
  </div>
</section>

For repeated items, prefer class lists plus CSS custom properties over generating class names dynamically:

<span class="inline-block translate-y-[calc(var(--i)*6px)] opacity-80" style="--i: 0"></span>
<span class="inline-block translate-y-[calc(var(--i)*6px)] opacity-80" style="--i: 1"></span>
<span class="inline-block translate-y-[calc(var(--i)*6px)] opacity-80" style="--i: 2"></span>

Dynamic Class Safety

Tailwind's browser runtime scans the current document and generates CSS for class names it can see. Do not build render-critical class names only at seek time:

// Risky: Tailwind may not see every generated class before capture.
element.className = `bg-${color}-500`;

Use complete class names in HTML, data attributes, or explicit CSS instead:

<div data-tone="blue" class="bg-blue-500 data-[tone=rose]:bg-rose-500"></div>

If a generated class is unavoidable, make sure the full class token appears in a text/tailwindcss block before validation.

Video-Specific Guardrails

  • Use stable dimensions: w-[...], h-[...], aspect-video, grid, flex, and fixed padding for video layouts.
  • Prefer transforms and opacity for animated properties.
  • Keep Tailwind transitions out of render-critical timing unless a seekable runtime owns the state.
  • Avoid hover, focus, scroll, viewport, or pointer variants for content that must render deterministically.
  • Use explicit border colors. Tailwind v4 changed the default border behavior from v3, so border border-white/20 is safer than bare border.
  • Use v4 utility names: shadow-xs, rounded-xs, outline-hidden, shrink-*, and grow-* where those replacements apply.
  • Be careful with modern CSS utilities if the output needs older browser support. Tailwind v4 targets modern browsers.

Validation

After editing a Tailwind-enabled composition:

npx hyperframes lint
npx hyperframes validate
npx hyperframes inspect

For a render proof:

npx hyperframes render . --workers 1 --quality draft --output tailwind-proof.mp4

The validation path should show no missing-style flashes on frame 0. If styles appear in preview but not render, check that window.__tailwindReady exists and resolves before capture.

Quick Debug Checklist

  1. Confirm the project was scaffolded with hyperframes init --tailwind.
  2. Confirm the script points to @tailwindcss/browser@4.2.4.
  3. Confirm window.__tailwindReady is present.
  4. Replace v3 @tailwind directives with v4 browser-runtime CSS.
  5. Move custom tokens from tailwind.config.js to @theme.
  6. Replace dynamically assembled classes with complete static tokens.
  7. Run npx hyperframes validate and render a short proof.

Credits And References