色・コントラスト
色を HEX、RGB、HSL、OKLCH の間で変換し、明るい背景と暗い背景に対する WCAG 2.1 のコントラストを確認します。
ブラウザ内だけで動作します。入力した内容はどこにもアップロードされません。
通常のテキストは 4.5 : 1(AA)または 7 : 1(AAA)が必要です。大きなテキストと UI の枠線は 3 : 1 です。
:root {
--color-brand: #3B82F6;
--color-brand-rgb: 59 130 246;
--color-brand-hsl: hsl(217, 91%, 60%);
--color-brand-oklch: oklch(62.3% 0.188 259.8);
}@theme {
--color-brand: #3B82F6;
}
text-brand bg-brand border-brand
text-[#3B82F6] bg-[#3B82F6]WCAG コントラストリファレンス
クイックリファレンス- 4.5 : 1
- AA の通常本文テキストの最小比です。24px の通常または 18.66px の太字まで適用されます。
- 3 : 1
- 大きなテキストと UI 部品の枠線・アイコンに対する AA の最小比です。
- 7 : 1
- すべてのサイズのテキストに対する AAA の基準です。大きなテキストは 4.5 : 1 で AAA です。
- (L1 + 0.05) / (L2 + 0.05)
- コントラストの計算式です。L はガンマ補正を加えた相対輝度です。
- #RRGGBBAA
- 8桁の16進数はアルファチャンネルを加えます。CSS の rgb() は 0-255 と 0-1 のアルファを使います。
- OKLCH
- 知覚的に均一な明度と彩度なので、同じ刻みが同じに見え、色相がコントラストを保ちます。
React の関連文法ガイド
React のガイドをすべて見るReact 19 Ref Cleanup Functions and forwardRef Deprecation
ref is a normal prop now and a ref callback may return a cleanup function, which breaks every implicit-return callback. Migration steps and the leak it fixes.
ReactReact 19 Hydration Mismatch: Error 418 and 421 Root Causes
React discards the server HTML as soon as the first client render differs. The deterministic-value fixes for #418, the attribute mismatch behind #421, and how to read the diff.
ReactReact Maximum Update Depth Exceeded: Finding the Update Loop
Fifty nested updates and React gives up. The loop is always a new identity: an inline object in a dependency array, a setState in render, or a selector that returns a fresh array.
ReactReact Profiler API: Measuring Render Timings and Identifying Wasted Re-Renders
actualDuration versus baseDuration, phase names that tell you who triggered a commit, and how to ship the numbers without flooding a backend.