标签:字符串 调用 color less div content web near nim
在a.less中导入base.less
a.less中的代码
.animate-ripple-ink{ .animation(ripple .5s linear;{ 100%{ opacity: 0; .transform(scale(2.5)); } }); }
base.less中的代码
.animation(@value;@content){ -webkit-animation: @value; -moz-animation: @value; -o-animation: @value; -ms-animation: @value; animation: @value; .keyframes(~`"@{value}".split(/,\s+/)[0].replace("[","")`,@content); }
@value的值为[ripple, .5s, linear]
"@{value}"成为字符串"[ripple, .5s, linear]",避免js解析错误。
~避免编译,不加则输出为"ripple"
Tips:
.animate-ripple-ink{ .animation(ripple .5s linear;{ 100%{ opacity: 0; .transform(scale(2.5)); } });
少一个},less竟然不报错,而是调用一个参数的.animation !我觉的这是一个bug。
标签:字符串 调用 color less div content web near nim
原文地址:http://www.cnblogs.com/resolvent/p/6984149.html