diff --git a/readme.md b/readme.md index fd140ae..2ee1de9 100644 --- a/readme.md +++ b/readme.md @@ -18,7 +18,9 @@ import { sass } from '@stencil/sass'; export const config: Config = { plugins: [ - sass() + sass({ + // Optional config options + }) ] }; ``` @@ -51,6 +53,27 @@ exports.config = { Note that each of these files are always added to each component, so in most cases they shouldn't contain CSS because it'll get duplicated in each component. Instead, `injectGlobalPaths` should only be used for Sass variables, mixins and functions, but does not contain any CSS. +### Warning Controls + +To control and suppress different types of Sass warnings you can use the following options: + +- `quietDeps`: Silences warnings from dependencies (files loaded through `loadPaths` or `importers`) +- `silenceDeprecations`: Silences specific deprecation warnings by their identifiers (e.g., 'import' for @import rule warnings) + +```js +exports.config = { + plugins: [ + sass({ + // Silence all dependency warnings + quietDeps: true, + // Silence specific deprecation warnings + silenceDeprecations: ['import'] + }) + ] +}; +``` + + ## Related * [sass](https://www.npmjs.com/package/sass) @@ -62,4 +85,4 @@ Note that each of these files are always added to each component, so in most cas ## Contributing -Please see our [Contributor Code of Conduct](https://github.com/stenciljs/.github/blob/main/CODE_OF_CONDUCT.md) for information on our rules of conduct. \ No newline at end of file +Please see our [Contributor Code of Conduct](https://github.com/stenciljs/.github/blob/main/CODE_OF_CONDUCT.md) for information on our rules of conduct. diff --git a/src/declarations.ts b/src/declarations.ts index b64e7ef..def7e68 100644 --- a/src/declarations.ts +++ b/src/declarations.ts @@ -1,3 +1,5 @@ +import type { DeprecationOrId } from 'sass-embedded'; + export * from '@stencil/core/internal'; export interface PluginOptions { @@ -73,6 +75,19 @@ export interface PluginOptions { */ outputStyle?: 'compressed' | 'expanded'; + /** + * If true, Sass won't print warnings that are caused by dependencies. + * A "dependency" is defined as any file that's loaded through loadPaths or importers. + * Stylesheets that are imported relative to the entrypoint are not considered dependencies. + */ + quietDeps?: boolean; + + /** + * If true, Sass won't print warnings that are caused by deprecated features. + * @see: https://sass-lang.com/documentation/js-api/interfaces/stringoptions/#silenceDeprecations + */ + silenceDeprecations?: DeprecationOrId[]; + /** * Enables the outputting of a source map. */