📅 You're Invited: Meet the Socket team at RSAC (April 28 – May 1).RSVP

inline-style-prefixer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

inline-style-prefixer

Run-time Autoprefixer for JavaScript style objects

7.0.1
latest
Version published
Weekly downloads
2.9M
-10.8%
Maintainers
1
Weekly downloads
 
Created

What is inline-style-prefixer?

The inline-style-prefixer is a JavaScript library used for automatically adding vendor prefixes to CSS styles defined in JavaScript objects. This is particularly useful when developing React applications that handle styles primarily in JavaScript. The prefixer uses the user agent to determine which prefixes are necessary for the current browser, ensuring cross-browser compatibility for CSS properties that require vendor prefixes.

What are inline-style-prefixer's main functionalities?

Automatic Prefixing

Automatically adds necessary CSS vendor prefixes to style objects based on the current browser's requirements.

{"display": 'flex'} // becomes {'display': ['-webkit-box', '-moz-box', '-ms-flexbox', '-webkit-flex', 'flex']} after processing

User Agent Based Prefixing

Initializes the prefixer with a specific user agent to tailor the prefixing process to a particular browser's needs.

const prefixer = new Prefixer({userAgent: 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.36'}); const style = prefixer.prefix({display: 'flex'});

Other packages similar to inline-style-prefixer

FAQs

Package last updated on 04 Jul 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts