【发布时间】:2021-11-27 17:31:17
【问题描述】:
我正在尝试在 tailwind-CSS 配置中添加新颜色。
并在课堂内使用新颜色作为背景。
但我得到了错误:
// index.scss
// Here I am trying to apply green-100 as a background color
.focus-unanswered-question {
@apply: bg-green-100;
transition: background-color 1s ease;
}
由于这段代码,我收到下一条错误消息:
错误:需要一个伪类或伪元素。
// tailwind.config.js
module.exports = {
theme: {
},
colors: {
transparent: 'transparent',
black: '#000',
white: '#FFF',
status: {
yellow: '#ffbf29',
red: '#cc2a18',
},
green: {
100: '#fbfcfc',
},
}
【问题讨论】:
-
我认为
apply后面不应该有冒号。见stackoverflow.com/questions/41067550/what-is-apply-in-css。 -
天哪,你是对的
标签: html css tailwind-css