@byronogis/postcss-global-data
v1.0.1
Published
PostCSS plugin to define global data that will be injected into PostCSS for use in other plugins.
Downloads
37
Maintainers
Readme
postcss-global-data
Forked from @csstools/[email protected], motivated by this issue
Changes:
- can also pass a object to the
fileselement to control the behavior of the plugin
export interface FileConfig {
file: string
/**
* Whether to remove the inject CSS after processing.
* @default true to respect original plugin `@csstools/postcss-global-data` behavior
*/
remove?: boolean
/**
* Position to insert the CSS.
* @default 'append' to respect original plugin `@csstools/postcss-global-data` behavior
*/
position?: 'append' | 'prepend'
}Installation
# ✨ Auto-detect
npx nypm install @byronogis/postcss-global-data
# npm
npm install @byronogis/postcss-global-data
# yarn
yarn add @byronogis/postcss-global-data
# pnpm
pnpm install @byronogis/postcss-global-data
# bun
bun install @byronogis/postcss-global-data
# deno
deno install @byronogis/postcss-global-dataBasic Usage
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
- 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 devorpnpm test
Sponsors
License
Published under the MIT license. Made by @byronogis and community 💛
🤖 auto updated with automd (last updated: Sat Aug 16 2025)
