Less mixin with optional parameters
问题 I have a Less mixin defined as: .fontStyle(@family, @size, @weight: normal, @style: normal, @color: #ffffff, @letter-spacing: normal) { font-family: @family; font-size: @size; color: @color; font-weight: @weight; font-style: @style; letter-spacing: @letter-spacing; } How can I define usage like: .fontStyle('NimbusSansNovCon-Reg', 12px, , , , 0.1em); I.E. use the defaults for @weight , @style , @color 回答1: To supply a parameter that far down the string of arguments, you have to also supply the