v7.0.0
- FEATURE:
contains()
checks multiple block with matching selectors. #243 - BREAKING: Upgrade to newer Sass API
- Add True
sourceType
option (path
[default] orstring
) - Reverse order of expected arguments to
runSass
: 1) True options, 2) source path (or string), 3) optional Sass options - Note that some of the Sass options have changed. For example,
includePaths
is nowloadPaths
,outputStyle
is nowstyle
,importer
is nowimporters
, etc. See the Dart Sass documentation for more details.
- Add True
- BREAKING: Require
sass
(>=1.45.0
) as a peer-dependency, removing Truesass
option - BREAKING: Drop support for node < 14.15.0
- INTERNAL: Use both Jest and Mocha for internal testing
- INTERNAL: Remove documentation from npm package
- INTERNAL: Update dependencies
Migrating from v6
runSass
arguments have changed:
v6:
const path = require('path');
const sass = require('node-sass');
const sassTrue = require('sass-true');
const sassFile = path.join(__dirname, 'test.scss');
sassTrue.runSass(
// Sass options [required]
{ file: sassFile, outputStyle: 'compressed', includePaths: ['node_modules'] },
// True options [required]
{ describe, it, sass },
);
const sassString = `
h1 {
font-size: 40px;
}`;
sassTrue.runSass(
// Sass options [required]
{
data: sassString,
outputStyle: 'compressed',
includePaths: ['node_modules'],
},
// True options [required]
{ describe, it, sass },
);
v7:
const path = require('path');
const sassTrue = require('sass-true');
const sassFile = path.join(__dirname, 'test.scss');
sassTrue.runSass(
// True options [required]
{ describe, it },
// Sass source (path) [required]
sassFile,
// Sass options [optional]
{ style: 'compressed', loadPaths: ['node_modules'] },
);
const sassString = `
h1 {
font-size: 40px;
}`;
sassTrue.runSass(
// True options [required]
{ describe, it, sourceType: 'string' },
// Sass source (string) [required]
sassString,
// Sass options [optional]
{ style: 'compressed', loadPaths: ['node_modules'] },
);
New Contributors
Full Changelog: v6.1.0...v7.0.0