inline-style-prefixer is a JavaScript library designed to automatically add vendor prefixes to CSS properties within JavaScript style objects at runtime. Currently stable at version 7.0.1, the library has seen sporadic major releases (e.g., a jump from v3 to v7) but maintains active development within its major versions. Its primary function is to ensure cross-browser compatibility for modern CSS properties by intelligently applying prefixes only where necessary for its supported browser matrix (e.g., Chrome 55+, Firefox 52+), rather than prefixing all properties indiscriminately. Key differentiators include its small footprint, speed, and simplicity, offering a functional API. It is widely adopted by popular styling-in-JS libraries such as Aphrodite, Fela, Material UI, and styled-components, providing a reliable solution for managing vendor prefixes in complex web applications.
npm install inline-style-prefixerVerified import paths — ran on the pinned version, not inferred.
Demonstrates how to import and use the `prefix` function to automatically add vendor prefixes to a JavaScript style object.
Update import statements and usage from `new Prefixer().prefix(style)` to `import { prefix } from 'inline-style-prefixer'; prefix(style)` for simple cases, or `import { createPrefixer } from 'inline-style-prefixer'; const customPrefixer = createPrefixer(config); customPrefixer.prefix(style)` for custom configurations.Review the 'Browser Support' and 'Data Reference' documentation to understand which properties are prefixed. For legacy browser support, use a custom prefixer configuration as described in the official guides.
Install the official type definitions: `npm install --save-dev @types/inline-style-prefixer` or `yarn add -D @types/inline-style-prefixer`.
Ensure you are using named imports for ESM: `import { prefix } from 'inline-style-prefixer'` or destructuring for CJS: `const { prefix } = require('inline-style-prefixer')`.Update your code to use the modern functional API: `import { prefix } from 'inline-style-prefixer'; prefix(style)` or `import { createPrefixer } from 'inline-style-prefixer'`.No dependency data recorded yet.