JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 32
  • Score
    100M100P100Q86345F
  • License MIT

Testable Sass error/warn/debug functions/mixins

Package Exports

  • @lunelson/sass-throw

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@lunelson/sass-throw) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

sass-throw

Build Status

Make @error, @warn and @debug messages testable in Sass.

Use error(), warn() and debug() functions (or mixins) instead of the built-in @error, @warn and @debug directives. When the global variable $st-catch is set to true, messages will be captured rather than output, and can be inspected with last-error() last-warn() and last-debug() respectively.

# install
npm install --save @lunelson/sass-throw
// test.scss
@import 'sass-throw/index';
$st-catch: true;
.test {
  // error as function
  value: error('something went wrong');
  error: last-error();
  // debug as mixin
  @include debug('this is a debug message');
  debug: last-debug();
}
/* test.css */
.test {
  error: "something went wrong";
  debug: "this is a debug message";
}

Questions? File an issue, or tweet at me.