Snipt.net is closing on December 31st, 2016

For more information, please visit this blog post.

snipt

Ctrl+h for KB shortcuts

Sass

opacity with IE8 fallback - LESS mixin

1
2
3
4
5
6
7
/* http://getpreboot.com/#mixins-opacity */

.opacity(@opacity) {
  opacity: @opacity;
  @opacity-ie: @opacity * 100;
  filter: ~"alpha(opacity=@{opacity-ie})"; // IE8
}
https://snipt.net/embed/f0d51c22ce9cb0cbaabe2b7470205629/
https://snipt.net/raw/f0d51c22ce9cb0cbaabe2b7470205629/
f0d51c22ce9cb0cbaabe2b7470205629
sass
Sass
7
2016-12-03T09:22:14
True
False
False
/api/public/snipt/88265/
opacity-with-ie-fallback-less-mixon
<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></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a><span class="cm">/* http://getpreboot.com/#mixins-opacity */</span> </span><span id="L-2"><a name="L-2"></a> </span><span id="L-3"><a name="L-3"></a><span class="nc">.opacity</span><span class="o">(@</span><span class="nt">opacity</span><span class="o">)</span> <span class="err">{</span> </span><span id="L-4"><a name="L-4"></a> <span class="na">opacity</span><span class="o">:</span> <span class="o">@</span><span class="no">opacity</span><span class="err">;</span> </span><span id="L-5"><a name="L-5"></a> <span class="k">@opacity-ie</span><span class="nd">:</span> <span class="o">@</span><span class="nt">opacity</span> <span class="o">*</span> <span class="nt">100</span><span class="o">;</span> </span><span id="L-6"><a name="L-6"></a> <span class="na">filter</span><span class="o">:</span> <span class="o">~</span><span class="s2">&quot;alpha(opacity=@{opacity-ie})&quot;</span><span class="err">;</span> <span class="c1">// IE8</span> </span><span id="L-7"><a name="L-7"></a><span class="err">}</span> </span></pre></div> </td></tr></table>
less

Sass

box (drop) shadows - LESS mixin

1
2
3
4
.box-shadow(@shadow: 0 1px 3px rgba(0,0,0,.25)) {
  -webkit-box-shadow: @shadow; // iOS <4.3 & Android <4.1
          box-shadow: @shadow;
}
https://snipt.net/embed/46e84414eafaa68af56e0dac031a2d81/
https://snipt.net/raw/46e84414eafaa68af56e0dac031a2d81/
46e84414eafaa68af56e0dac031a2d81
sass
Sass
4
2016-12-06T05:18:25
True
False
False
/api/public/snipt/88256/
box-drop-shadows-less-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></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a><span class="na">.box-shadow(@shadow</span><span class="o">:</span> <span class="mi">0</span> <span class="mi">1</span><span class="kt">px</span> <span class="mi">3</span><span class="kt">px</span> <span class="nf">rgba</span><span class="p">(</span><span class="mi">0</span><span class="o">,</span><span class="mi">0</span><span class="o">,</span><span class="mi">0</span><span class="o">,.</span><span class="mi">25</span><span class="p">))</span> <span class="err">{</span> </span><span id="L-2"><a name="L-2"></a> <span class="na">-webkit-box-shadow</span><span class="o">:</span> <span class="o">@</span><span class="n">shadow</span><span class="err">;</span> <span class="c1">// iOS &lt;4.3 &amp; Android &lt;4.1</span> </span><span id="L-3"><a name="L-3"></a> <span class="na">box-shadow</span><span class="o">:</span> <span class="o">@</span><span class="n">shadow</span><span class="err">;</span> </span><span id="L-4"><a name="L-4"></a><span class="err">}</span> </span></pre></div> </td></tr></table>
less

Sass

opacity - LESS mixin

1
2
3
4
5
.opacity(@opacity) {
    opacity: @opacity;
    @opacity-ie: @opacity * 100;
    filter: ~"alpha(opacity=@{opacity-ie})"; // IE8
}
https://snipt.net/embed/4faf0af27aceda8a657321f342ab736a/
https://snipt.net/raw/4faf0af27aceda8a657321f342ab736a/
4faf0af27aceda8a657321f342ab736a
sass
Sass
5
2016-12-02T18:42:09
True
False
False
/api/public/snipt/88248/
opacity-less-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></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a><span class="nc">.opacity</span><span class="o">(@</span><span class="nt">opacity</span><span class="o">)</span> <span class="err">{</span> </span><span id="L-2"><a name="L-2"></a> <span class="na">opacity</span><span class="o">:</span> <span class="o">@</span><span class="no">opacity</span><span class="err">;</span> </span><span id="L-3"><a name="L-3"></a> <span class="k">@opacity-ie</span><span class="nd">:</span> <span class="o">@</span><span class="nt">opacity</span> <span class="o">*</span> <span class="nt">100</span><span class="o">;</span> </span><span id="L-4"><a name="L-4"></a> <span class="na">filter</span><span class="o">:</span> <span class="o">~</span><span class="s2">&quot;alpha(opacity=@{opacity-ie})&quot;</span><span class="err">;</span> <span class="c1">// IE8</span> </span><span id="L-5"><a name="L-5"></a><span class="err">}</span> </span></pre></div> </td></tr></table>
less
Copyrighted, illegal, or inappropriate content? Email [email protected].