PostCSS plugin to define global data that will be injected into PostCSS for use in other plugins.
npm install @byronogis/postcss-global-data





[![JSDocs][jsdocs-src]][jsdocs-href]
Forked from @csstools/postcss-global-data@3.0.0, motivated by this issue
Changes:
- can also pass a object to the files element to control the behavior of the plugin
``ts [type.ts]@csstools/postcss-global-data
export interface FileConfig {
file: string
/**
* Whether to remove the inject CSS after processing.
* @default true to respect original plugin behavior@csstools/postcss-global-data
*/
remove?: boolean
/**
* Position to insert the CSS.
* @default 'append' to respect original plugin behavior`
*/
position?: 'append' | 'prepend'
}
`sh✨ Auto-detect
npx nypm install @byronogis/postcss-global-data
Basic Usage
`ts
postcssGlobalData({
files: [
'path/to/file.css',
// now you can also pass an object to control the behavior
// of the plugin for each file
{
file: 'path/to/file.css',
remove: false,
position: 'prepend',
}
],
})
`Contribution
Local development
- Clone this repository
- Install the latest LTS version of Node.js
- Enable Corepack using
corepack enable
- Install dependencies using pnpm install
- Run tests using pnpm dev or pnpm test`Published under the MIT license.
Made by @byronogis and community 💛
---
_🤖 auto updated with automd (last updated: Sat Aug 16 2025)_
[jsdocs-src]: https://img.shields.io/badge/jsdocs-reference-1fa669
[jsdocs-href]: https://www.jsdocs.io/package/@byronogis/postcss-global-data