【发布时间】:2016-07-31 05:07:53
【问题描述】:
当您将鼠标悬停在每个按钮上时,我想使它们变暗,但我不知道如何引用 :hover 属性中的原始颜色值。
//buttons.scss
//Define the colors
$tumblr-color: #35455C;
$twitter-color: #5AB6FC;
//Put these colors into classes
.btn-tumblr
{
color: $tumblr-color;
}
.btn-twitter
{
color: $twitter-color;
}
//Add the "darkens when hovered over" attribute
.btn-tumblr,
.btn-twitter
{
&:hover
{
color: darken(/*ATTRIBUTE OF THE ORIGINAL COLOR HERE*/, 20%);
}
}
【问题讨论】: