snipt

Ctrl+h for KB shortcuts

CSS

.Less multiple argument mixin

.transition (@value1,@value2:X,...)
{
    @value: ~`"@{arguments}".replace(/[\[\]]|\,\sX/g, '')`;

    -webkit-transition: @value;
    -moz-transition: @value;
    -ms-transition: @value;
    -o-transition: @value;
    transition: @value;
}
https://snipt.net/embed/479faa3d59d2cc2c81743a5c3f4d606a/
/raw/479faa3d59d2cc2c81743a5c3f4d606a/
479faa3d59d2cc2c81743a5c3f4d606a
css
CSS
10
2019-06-17T03:18:00
True
False
False
Apr 08, 2014 at 09:22 AM
/api/public/snipt/115933/
less-multiple-argument-mixin
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1"> 1</a> <a href="#L-2"> 2</a> <a href="#L-3"> 3</a> <a href="#L-4"> 4</a> <a href="#L-5"> 5</a> <a href="#L-6"> 6</a> <a href="#L-7"> 7</a> <a href="#L-8"> 8</a> <a href="#L-9"> 9</a> <a href="#L-10">10</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a><span class="nc">.transition</span> <span class="o">(</span><span class="k">@value1</span><span class="o">,</span><span class="k">@value2</span><span class="nd">:X</span><span class="o">,...)</span> </span><span id="L-2"><a name="L-2"></a><span class="p">{</span> </span><span id="L-3"><a name="L-3"></a> <span class="k">@value</span><span class="o">:</span> <span class="o">~</span><span class="err">`</span><span class="s2">&quot;@{arguments}&quot;</span><span class="nc">.replace</span><span class="o">(/[</span><span class="err">\</span><span class="o">[</span><span class="err">\</span><span class="o">]]|</span><span class="err">\</span><span class="o">,</span><span class="err">\</span><span class="nt">sX</span><span class="o">/</span><span class="nt">g</span><span class="o">,</span> <span class="s1">&#39;&#39;</span><span class="o">)</span><span class="err">`</span><span class="p">;</span> </span><span id="L-4"><a name="L-4"></a> </span><span id="L-5"><a name="L-5"></a> <span class="nt">-webkit-transition</span><span class="o">:</span> <span class="k">@value</span><span class="p">;</span> </span><span id="L-6"><a name="L-6"></a> <span class="nt">-moz-transition</span><span class="o">:</span> <span class="k">@value</span><span class="p">;</span> </span><span id="L-7"><a name="L-7"></a> <span class="nt">-ms-transition</span><span class="o">:</span> <span class="k">@value</span><span class="p">;</span> </span><span id="L-8"><a name="L-8"></a> <span class="nt">-o-transition</span><span class="o">:</span> <span class="k">@value</span><span class="p">;</span> </span><span id="L-9"><a name="L-9"></a> <span class="nt">transition</span><span class="o">:</span> <span class="k">@value</span><span class="p">;</span> </span><span id="L-10"><a name="L-10"></a><span class="p">}</span> </span></pre></div> </td></tr></table>
arguments, css, less, mixin