Skip to content

Instantly share code, notes, and snippets.

@whroman
whroman / batchPaths.js
Last active August 29, 2015 14:00
DRY up your file-include-intensive scripts with batchPaths.js. Use cases include Grunt and Gulp task declarations.
var batchPaths = function() {
var _prefix = '';
var _suffix = '';
// _all (Array)
// Populated by calling batchPaths.add(Array).
var _all = [];
// Method: prefix
// Args: toPrefix (String)
//==== SCSS mixin to create CSS triangles
//==== Examples:
//==== @include triangle ("up", #fff, 10px, 20px);
//==== @include triangle("up", #000, 20px);
@mixin triangle ($direction: "down", $color: #000, $width: 20px, $height: $width ) {
width: 0;
height: 0;
border-left: #{setTriangleSide($direction, "left", $width, $height, $color)};
border-right: #{setTriangleSide($direction, "right", $width, $height, $color)};
border-bottom: #{setTriangleSide($direction, "down", $width, $height, $color)};