LessCss - 传递"方法"的参数。没有冗余

时间:2016-08-11 07:41:20

标签: css web less

有没有办法避免冗余:

.bg-gradient-glossy(
                @from:top, 

                @from-color-0:rgba(255,255,255,.4),
                @from-percent-0:0%,

                @to-color-0:rgba(255,255,255,0.2),
                @to-percent-0:50%,

                @from-color-1:rgba(255,255,255,0),
                @from-percent-1:50%,

                @to-color-1:rgba(255,255,255,0.1),
                @to-percent-1:100%
        ) {
                .XY.bg-gradient(
                        @from:@from,
                        @from-color-0:@from-color-0,
                        @to-color-0:@to-color-0,
                        @from-color-1:@from-color-1,
                        @to-color-1:@to-color-1,
                        @from-percent-0:@from-percent-0,
                        @to-percent-0:@to-percent-0,
                        @from-percent-1:@from-percent-1,
                        @to-percent-1:@to-percent-1
                );
        }

正如您所看到的,我基本上只需要传递它们。是否有 less.apply(this,arguments)之类的功能或对所有要传递的参数的引用?

0 个答案:

没有答案