less-website에서 다음 예제를 발견했습니다. 이것들은 그림자를 만드는 명령입니다. 같은 함수 이름을 가지고 있기 때문에 어떤 것이 먼저 호출되는지 궁금합니다. 왜 그들은 같은 이름을 가지고 있습니까?동일한 이름을 가진 두 함수
@base: #f938ab;
.box-shadow(@style, @c) when (iscolor(@c)) {
-webkit-box-shadow: @style @c;
-moz-box-shadow: @style @c;
box-shadow: @style @c;
}
.box-shadow(@style, @alpha: 50%) when (isnumber(@alpha)) {
.box-shadow(@style, rgba(0, 0, 0, @alpha));
}
[패턴 일치] (http://lesscss.org/features/#mixins-parametric-feature-pattern-matching) 및 [믹스 가드] (http://lesscss.org/features/#mixin-guards)를 참조하십시오. -특색). –