I've also just converted to LessCSS mixin. Free for your use. (I added a 6th argument so that you can change the class name that gets generated).<p>Clickable: <a href="https://gist.github.com/2644661" rel="nofollow">https://gist.github.com/2644661</a><p><pre><code> .arrowgasm(@position: top, @size : "4px", @background-color : #88b7d5,
@border-width: "2px", @border-color : #c2e1f5, @arrowClass : "arrow_box"){
(~".@{arrowClass}") {
position: relative;
background: @background-color;
border: @size solid @border-color;
}
(~".@{arrowClass}:after"), (~".@{arrowClass}:before") {
bottom: 100%;
border: solid transparent;
content: " ";
height: 0;
width: 0;
position: absolute;
pointer-events: none;
}
(~".@{arrowClass}:after") {
.b(@position, @background-color);
border-width: @size;
left: 50%;
margin-left: @size * -1;
}
(~".@{arrowClass}:before") {
.b(@position, @border-color);
border-width: @size + @border-width ;
left: 50%;
margin-left: ( @size + @border-width ) * -1;
}
.b(top, @border-color) { border-bottom-color: @border-color; }
.b(right, @border-color) { border-left-color: @border-color; }
.b(bottom, @border-color){ border-top-color: @border-color; }
.b(left, @border-color) { border-right-color: @border-color; }
}</code></pre>