示例工程 05-colors-units-values
05-colors-units-values/demo-01-colors/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 8px;
font-size: 28px;
}
code {
padding: 1px 5px;
border-radius: 4px;
background: #f1f5f9;
font-family: ui-monospace, monospace;
font-size: 0.9em;
}
.row {
display: flex;
flex-wrap: wrap;
gap: 10px;
margin-top: 12px;
}
.chip {
display: grid;
place-items: center;
min-width: 150px;
min-height: 72px;
border-radius: 10px;
color: #ffffff;
font-family: ui-monospace, monospace;
font-size: 12px;
}
.hex { background: #2563eb; }
.rgb { background: rgb(37 99 235); }
.hsl { background: hsl(221 83% 53%); }
.mix { background: color-mix(in oklch, #2563eb 70%, #7c3aed); }
.alpha { background: rgb(37 99 235 / 50%); color: #0f172a; }
.alpha-strong { background: rgb(37 99 235 / 80%); }