How to use postcss-modules-local-by-default - 1 common examples

To help you get started, we’ve selected a few postcss-modules-local-by-default 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 css-modules / css-modules-require-hook / src / extractor.js View on Github external
} = {}, fetch) {
  let scopedName;
  if (generateScopedName) {
    scopedName = typeof generateScopedName !== 'function'
      ? genericNames(generateScopedName || '[name]__[local]___[hash:base64:5]', {context})
      : generateScopedName;
  } else {
    // small fallback
    scopedName = (local, filename) => Scope.generateScopedName(local, relative(context, filename));
  }

  const plugins = (use || [
    ...prepend,
    Values,
    mode
      ? new LocalByDefault({mode})
      : LocalByDefault,
    createImportedName
      ? new ExtractImports({createImportedName})
      : ExtractImports,
    new Scope({generateScopedName: scopedName}),
    ...append,
  ]).concat(new Parser({fetch})); // no pushing in order to avoid the possible mutations

  return postcss(plugins);
}

postcss-modules-local-by-default

A CSS Modules transform to make local scope the default

MIT
Latest version published 1 month ago

Package Health Score

80 / 100
Full package analysis

Popular postcss-modules-local-by-default functions