How to use dart-sass - 1 common examples

To help you get started, we’ve selected a few dart-sass examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github material-components / material-components-web / test / scss / verify-feature-targeting.js View on Github external
// Support omission of leading _ for partials
    const resolved = tryAccess(scssPath) ||
      tryAccess(path.join(path.dirname(scssPath), `_${path.basename(scssPath)}`));
    return {file: resolved || url};
  }
  return {file: url};
}

// Verify that the Sass compiles when we ask for all features.
sass.renderSync({
  file: path.join(__dirname, 'feature-targeting-select-all.scss'),
  importer: materialImporter,
});

// Verify that the Sass produces no CSS when we ask for no features.
const result = sass.renderSync({
  file: path.join(__dirname, 'feature-targeting-select-none.scss'),
  importer: materialImporter,
});
const css = result.css.toString('utf8').trim();

if (css.length > 0) {
  console.error('All rules within applicable packages must be feature-targeted, but the following were not:');
  console.error(css);
  process.exit(1);
}

dart-sass

A pure JavaScript implementation of Sass.

MIT
Latest version published 5 years ago

Package Health Score

64 / 100
Full package analysis

Popular dart-sass functions