scss mx-CSS转换
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了scss mx-CSS转换相关的知识,希望对你有一定的参考价值。
<div class="card">
<button class="fade">transition mixin</button>
<p>mouseover to see fade effect</p>
</div>
<div class="card">
<button class="scale">transition mixin</button>
<p>mouseover to see scale effect</p>
</div>
/* element {
transition: [property] [duration] [timing-function] [delay];
} */
@mixin transition($what: all, $time: 0.2s, $how: ease-in-out, $delay: .01s) {
-webkit-transition: $what $time $how;
-moz-transition: $what $time $how;
-ms-transition: $what $time $how;
-o-transition: $what $time $how;
transition: $what $time $how;
}
/* mixin usage */
button.fade {
@include transition(all,0.5s,ease-out);
color: #00FFFF;
background-color: #0080FF;
border-color: #00FFFF;
&:hover {
color: #0080FF;
background-color: #00FFFF;
border-color: #0080FF;
}
}
button.scale {
@include transition(all,0.3s,ease-out);
color: #00FFFF;
background-color: #0080FF;
width: 18rem;
position: relative;
top: 0;
&:hover {
width: 22rem;
top: 10px;
}
}
/* demo styles */
.card {
margin: 2em auto;
text-align: center;
}
button {
border: 5px solid #00FFFF;
padding: .9em 2em 1em;
font-size: 1.5rem;
}
body {
text-align: center;
}
以上是关于scss mx-CSS转换的主要内容,如果未能解决你的问题,请参考以下文章
如何将scss转换成css文件
scss SASS,SCSS,mixin:PX到EM的转换
在实时服务器上自动将 SCSS 转换为 CSS
Gulp 没有将 scss 转换为 css
将scss文件转换成css文件
将 scss 转换为 css [关闭]