PostCSS plugin to prepend a banner and/or append a footer text comment to the resulting CSS file. The current stable version is 4.0.1, with no frequent releases (last major release in 2020). It provides options for inline single-line comments or multi-line styled comments, and supports `important` flag to preserve banners during minification (e.g., /*! … */). Unlike manual string concatenation, it integrates seamlessly into PostCSS pipeline and respects plugin ordering.
npm install postcss-bannerNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows how to import and use postcss-banner with banner, footer, and important options.
Set `inline: false` to restore previous multi-line comment style with leading asterisks.
Add `important: true` to the options object.
Run `npm install --save-dev postcss postcss-banner` to install both.
Ensure postcss-banner is listed after cssnano or other minifiers in the plugin array.
Use only one plugin for banners, or check if your minifier/other plugin already adds headers.
Use `import postcssBanner from 'postcss-banner'` or `const postcssBanner = require('postcss-banner')`.Update PostCSS to version 8 or later (`npm install postcss@latest`).
Add `"type": "module"` to package.json, or use CommonJS require().