Skip to content

rgb[a] 中使用 var

css
:root {
  /* #f0f0f0 in decimal RGB */
  --color: 240, 240, 240;
}

body {
  color: #000;
  background-color: #000;
}

#element {
  background-color: rgba(var(--color), 1);
}

参考资料

Released under the MIT License.