示例工程 44-color-functions
44-color-functions/demo-01-oklch/style.css
点击「运行示例」后,左侧显示源码、右侧显示运行结果;console 输出会实时回传。
body {
margin: 0;
padding: 32px;
background: #f8fafc;
color: #0f172a;
font-family: system-ui, sans-serif;
line-height: 1.7;
}
h1 { margin: 0 0 4px; font-size: 26px; }
p { margin: 16px 0 8px; color: #64748b; font-size: 14px; }
.row {
display: flex;
flex-wrap: wrap;
gap: 10px;
}
.box {
display: flex;
align-items: flex-end;
width: 120px;
height: 90px;
padding: 8px;
border-radius: 10px;
font-size: 11px;
font-family: ui-monospace, monospace;
}
.l95 { background: oklch(0.95 0.03 262); color: #0f172a; }
.l82 { background: oklch(0.82 0.08 262); color: #0f172a; }
.l62 { background: oklch(0.62 0.15 262); color: #ffffff; }
.l48 { background: oklch(0.48 0.13 262); color: #ffffff; }
.l32 { background: oklch(0.32 0.08 262); color: #ffffff; }
.c03 { background: oklch(0.62 0.03 262); color: #0f172a; }
.c08 { background: oklch(0.62 0.08 262); color: #ffffff; }
.c15 { background: oklch(0.62 0.15 262); color: #ffffff; }
.c22 { background: oklch(0.62 0.22 262); color: #ffffff; }
.h20 { background: oklch(0.62 0.15 20); color: #ffffff; }
.h140 { background: oklch(0.62 0.15 140); color: #0f172a; }
.h262 { background: oklch(0.62 0.15 262); color: #ffffff; }
.h320 { background: oklch(0.62 0.15 320); color: #ffffff; }