Tailwind CSS neutral 的 11 個色階,從最淺的 neutral-50 排到最深的 neutral-950。點一下數值就能複製。
HEX 與 RGB 為 Tailwind v3 的值,OKLCH 為 Tailwind v4 的值。點一下數值就能複製。
@theme {
--color-neutral-50: oklch(98.5% 0 none);
--color-neutral-100: oklch(97% 0 none);
--color-neutral-200: oklch(92.2% 0 none);
--color-neutral-300: oklch(87% 0 none);
--color-neutral-400: oklch(70.8% 0 none);
--color-neutral-500: oklch(55.6% 0 none);
--color-neutral-600: oklch(43.9% 0 none);
--color-neutral-700: oklch(37.1% 0 none);
--color-neutral-800: oklch(26.9% 0 none);
--color-neutral-900: oklch(20.5% 0 none);
--color-neutral-950: oklch(14.5% 0 none);
}module.exports = {
theme: {
extend: {
colors: {
neutral: {
50: '#fafafa',
100: '#f5f5f5',
200: '#e5e5e5',
300: '#d4d4d4',
400: '#a3a3a3',
500: '#737373',
600: '#525252',
700: '#404040',
800: '#262626',
900: '#171717',
950: '#0a0a0a'
}
}
}
}
}:root {
--neutral-50: #FAFAFA;
--neutral-100: #F5F5F5;
--neutral-200: #E5E5E5;
--neutral-300: #D4D4D4;
--neutral-400: #A3A3A3;
--neutral-500: #737373;
--neutral-600: #525252;
--neutral-700: #404040;
--neutral-800: #262626;
--neutral-900: #171717;
--neutral-950: #0A0A0A;
}在 Tailwind v3 中,neutral-500 是 #737373,也就是 rgb(115, 115, 115)。在 Tailwind v4 中定義為 oklch(55.6% 0 none)。
使用 bg-neutral-500、text-neutral-700、border-neutral-200 等 class。在 Tailwind v4 中,也可以在自己的 CSS 裡使用 CSS 變數 var(--color-neutral-500)。
Tailwind CSS、Material Design 與 Bootstrap 為各自所有者的商標。數值依據各專案的官方文件與公開套件:Tailwind CSS 4.3.3 / 3.4.19, material-colors, Material Web (tokens), Bootstrap 5.3.8 / 4.6.2。