所以我想改变或上的文字颜色hover focus
<div class="hover:text-green-500 focus:text-green-500">foo bar</div>
Run Code Online (Sandbox Code Playgroud)
但我想知道是否可以将所有内容压缩在一个语句中,这样我就不需要text-green-500对两者重复。我尝试了下面的代码,但它变成了and语句而不是or。
<div class="hover:focus:text-green-500">foo bar</div>
Run Code Online (Sandbox Code Playgroud)
在纯CSS中,我想要做的事情是这样的:
div:hover, div:focus {
color: green
}
Run Code Online (Sandbox Code Playgroud)
这在 TailwindCSS 中可能吗?