Skip to content
postcss-licensing
Menu

postcss-licensing License headers for your CSS

A PostCSS plugin that prepends your COPYRIGHT or LICENSE file to each stylesheet as a /*! … */ comment. No file? You get a warning, not a failed build.

  • Free & open source
  • License: MPL-2.0
  • Node 24+
Looks for COPYRIGHT, then LICENSE, in the working directory.
// postcss.config.js
import licensing from "@allons-y/postcss-licensing";

export default {
	plugins: [licensing()],
};

Install

npm install --save-dev @allons-y/postcss-licensing

Features

  • Finds your license file

    Checks COPYRIGHT, then LICENSE, in the working directory. Set filename & cwd to look anywhere else: the first match wins.

  • Survives minification

    The header is a /*! comment, the form most CSS minifiers keep, so the license reaches your published files.

  • Warns instead of failing

    A missing or empty license file adds a PostCSS warning that names where it looked. Your build keeps going.

  • Skips empty stylesheets

    Empty files stay empty instead of becoming a lone license comment. Turn skipIfEmpty off if you want the header anyway.

Allons-y Studio

Let's build something great together

A front-end & design systems studio helping teams ship consistent, accessible UI faster.