Home > Web Front-end > HTML Tutorial > Sharing of problems encountered when nested calls to less functions

Sharing of problems encountered when nested calls to less functions

零下一度
Release: 2017-06-24 11:55:04
Original
1626 people have browsed it

Import base.less into a.less
The code in a.less

.animate-ripple-ink{.animation(ripple .5s linear;{
100%{
opacity: 0;.transform(scale(2.5));}});
}
Copy after login

The code in 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);
}
Copy after login

The value of @value is [ripple, .5s, linear]
"@{value}" becomes the string "[ripple, .5s, linear]" to avoid js parsing errors.
~Avoid compilation, if not added, the output will be "ripple"
Tips:

.animate-ripple-ink{.animation(ripple .5s linear;{
100%{
opacity: 0;.transform(scale(2.5));}});
Copy after login

One less},less No error was reported, but .animation with a parameter was called! I think this is a bug.

The above is the detailed content of Sharing of problems encountered when nested calls to less functions. For more information, please follow other related articles on the PHP Chinese website!

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template