Home

Awesome

sass-maps-plus

'sass maps'

npm published v Build Status

Sass-Maps-Plus is aimed at providing advanced manipulation (and debugging!) for the Sass map data type. They are the successor to Sass List–Maps, which polyfilled maps in earlier versions of Sass; but use the native implementation of maps which are in [ruby] Sass as of version 3.3, and LibSass as of version 3.1.

With version 1.0.0, the main functions (map-get, map-set and map-merge) have been conformed to the feature-descriptions posted by @nex3 in this issue thread, which are the basis of a work-in-progress for the next version of ruby-sass.

$map: (a: (b: (c: d)));
.out {
  out: map-get($map, a, b, c); // => d
  out: map-set($map, a, b, c, x); // => (a: (b: (c: x)))
  out: map-merge($map, a, b, (c: x, d: y)); // => (a: (b: (c: x, d: y)))
}

Some earlier functions in this library have been deprecated; the one remaining addition here is map-print, for debugging maps in pretty-print format.

support Sass map data manipulation according to the description

They provide advanced native map data-type manipulation and inspection in libsass (as of version 3.1) and ruby-sass (as of version 3.3).

Installation

This is not currently registered in any package directories but can be installed from github via npm, and imported in node-sass and compliant tools, as long as the includePaths option includes 'node_modules'.

# in your project
npm install --save @lunelson/sass-maps-plus
// in your sass file, assuming you have 'node_modules' in Sass' search path
@import '@lunelson/sass-maps-plus/index';