【发布时间】:2013-02-23 22:10:28
【问题描述】:
我正在编写一个 @mixin,其中包含一些计算元素宽度百分比的数学运算,但由于它非常有用,我也想对其他属性使用相同的函数,例如边距和填充。
有没有办法将属性名称作为参数传递给 mixin?
@mixin w_fluid($property_name, $w_element,$w_parent:16) {
$property_name: percentage(($w_element/$w_parent));
}
【问题讨论】: