seed-dash - Sass Configuration Utilities
seed-dash is a specialized utility pack designed for the Seed CSS framework, specifically addressing the manipulation of configuration variables within Sass, particularly for lists and maps. It implements a limited set of Underscore/lodash-like methods such as `_get`, `_set`, and `_extend` directly in Sass to facilitate dynamic configuration adjustments. Released at version 0.0.2, the project appears to be unmaintained, with its last known activity several years ago. The project's own documentation recommends `Sass Dash` for a more comprehensive Underscore/lodash-like experience in Sass, indicating that seed-dash is a niche or superseded solution for very specific Seed framework configuration tasks, rather than a general-purpose Sass utility library. It is designed to be integrated into a build pipeline, typically via Node.js tools like Gulp.
Common errors
-
SassError: Can't find stylesheet to import. @import "pack/seed-dash/_index";
cause The Sass compiler's `includePaths` were not correctly configured to point to the `node_modules/seed-dash/dist` directory.fixEnsure that `gulp-sass` (or your chosen Sass compiler) is provided with an `includePaths` array that includes the result of `require('seed-dash')`. Example: `includePaths: require('seed-dash')`. -
TypeError: Cannot read properties of undefined (reading 'on') at Gulp.task (path/to/gulpfile.js:x:y)cause This often happens if `gulp-sass` is initialized incorrectly, especially with newer versions of `gulp-sass` that require you to explicitly pass the `sass` implementation (e.g., `require('sass')`).fixUpdate your `gulp-sass` initialization: `const sass = require('gulp-sass')(require('sass'));` to ensure it uses a compatible Sass compiler. -
Error: Node Sass does not yet support your current Node.js version.
cause The project's `package.json` specifies `engines: {"node": ">=4"}` which is extremely old. Modern `node-sass` versions (if still used) or `gulp-sass` might have compatibility issues with very old or very new Node.js runtimes.fixUse `sass` (Dart Sass) instead of `node-sass` for better Node.js version compatibility. If sticking with `node-sass`, ensure your Node.js version matches one supported by the specific `node-sass` version in your `node_modules`.
Warnings
- breaking The `seed-dash` package is explicitly unmaintained and has not received updates for several years. There are no guarantees of compatibility with modern Node.js versions, Sass compilers (e.g., Dart Sass), or contemporary build tooling. Expect potential breaking changes if integrating into a current ecosystem.
- deprecated The official documentation for `seed-dash` itself recommends `Sass Dash` as a 'much more complete Underscore/lodash-like experience for Sass'. This indicates that `seed-dash` is considered superseded by a more actively developed alternative.
- gotcha The package primarily provides `includePaths` for Sass compilation, and its 'methods' are Sass mixins/functions prefixed with `_`. Developers might incorrectly expect a JavaScript utility or try to `require` and execute functions from the `pack` object.
Install
-
npm install seed-dash -
yarn add seed-dash -
pnpm add seed-dash
Imports
- pack
import pack from 'seed-dash';
const pack = require('seed-dash'); - Sass include
@import "seed-dash";
@import "pack/seed-dash/_index";
- Sass function usage (example)
map-set($map, "key", "value");
@include _set($map, "key", "value");
Quickstart
const gulp = require('gulp');
const sass = require('gulp-sass')(require('sass')); // Using dart-sass
const pack = require('seed-dash');
const path = require('path');
gulp.task('sass', function () {
return gulp.src('./sass/**/*.scss')
.pipe(sass({
includePaths: [
...pack, // Includes seed-dash's own paths
path.join(__dirname, 'node_modules') // Ensure node_modules is also scanned
]
}).on('error', sass.logError))
.pipe(gulp.dest('./css'));
});
// To run:
// 1. Create a file `sass/main.scss`:
// `@import "pack/seed-dash/_index";
// $my-map: (
// 'foo': 'bar',
// 'nested': ('a': 1)
// );
// $my-map: _set($my-map, 'nested.b', 2);
// body { content: _get($my-map, 'nested.b'); }`
// 2. Install dependencies: `npm install gulp gulp-sass sass seed-dash`
// 3. Run: `npx gulp sass`