scss SASS:按钮Mixin
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了scss SASS:按钮Mixin相关的知识,希望对你有一定的参考价值。
/*
==========================================================================
$Sass Buttons
==========================================================================
*/
/*
* Mixin
*/
@mixin btn($btnColor: $colorBtn, $btnFontColor: $white, $btnFontSize: 2, $btnPadding: 5px 15px) {
display: table;
padding: $btnPadding;
background: $btnColor;
border: 1px solid darken($btnColor, 10%);
color: $btnFontColor;
text-decoration: none;
text-align: center;
@include remFallback(font-size, $btnFontSize);
@include text-shadow(2px 2px 2px rgba(darken($btnColor, 50%), 0.5));
@include border-radius(5px);
@include transition(background 0.2s ease);
&:hover {
background: darken($btnColor, 15%);
}
}
/* Placeholder
===================================================================== */
// $btnColor: $colorBtn, $btnFontColor: $white, $btnFontSize: 2
%btnRed {
@include btn($red);
}
%btnBlack {
@include btn($black);
}
%btnGray {
@include btn($grayLight);
}
%btnWhite {
@include btn($white, $black);
}
以上是关于scss SASS:按钮Mixin的主要内容,如果未能解决你的问题,请参考以下文章
scss SASS,SCSS,mixin:PX到EM的转换
scss Mixin Media查询段SASS
scss 变换Mixin Sass
scss Flexbox SASS Mixin:全部
scss Flexbox SASS Mixin:10。订购
scss Sass Link mixin