Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>You can use <a href="http://lesscss.org/#-string-interpolation" rel="nofollow noreferrer"><strong>string escaping and interpolation</strong></a> like this:</p> <pre><code>.links-transition (@arg:"color 1s, border-color 1s") { @color-time: ~"@{arg}"; -webkit-transition:@color-time; -moz-transition:@color-time; -ms-transition:@color-time; -o-transition:@color-time; transition:@color-time; } a { color:red; .links-transition ("color 2s, border-color 2s"); } </code></pre> <p>it will return this <strong>CSS</strong>:</p> <pre><code>a { color: red; -webkit-transition: color 2s, border-color 2s; -moz-transition: color 2s, border-color 2s; -ms-transition: color 2s, border-color 2s; -o-transition: color 2s, border-color 2s; transition: color 2s, border-color 2s; } </code></pre> <p>hope this does what you want.</p> <p><strong>For more ideas:</strong> there are some additinal approaches/solutions that you can find on SO, like this two for example:</p> <ul> <li><p><a href="https://stackoverflow.com/questions/11419741/less-css-mixins-with-variable-number-of-arguments/11552717#11552717">Less CSS: Mixins with Variable Number of Arguments</a></p></li> <li><p><a href="https://stackoverflow.com/questions/5510568/multiple-properties-are-getting-treated-as-separate-arguments-in-mixins/13490523#13490523">Multiple properties are getting treated as separate arguments in mixins</a></p></li> </ul> <hr> <h2>Update: in LESS 1.4 beta it works the way you wanted to do it:</h2> <pre><code>.links-transition (@color-time: color 1s, border-color 1s;) { -webkit-transition:@color-time; -moz-transition:@color-time; -ms-transition:@color-time; -o-transition:@color-time; transition:@color-time; } a { color:red; .links-transition (color 2s, border-color 2s;); } </code></pre> <p>has the same output as the above solution. <strong>Comma separated argunets are possible since 1.3.2, however they can apparently not include whitespaces.</strong></p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload