Security News
Weekly Downloads Now Available in npm Package Search Results
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
auto-prefixer
Advanced tools
this is a strong utility for adding prefixes for inline styles as used in React.js, that supports most css prefixes, browser or server rendering, and nested style objects.
var prefixedStyle = autoprefix(stylesObject);
import autoprefix from 'autoprefix';
var Component = React.createClass({
render() {
return (
<div style={autoprefix({flexDirection:'row'})>
auto-prefixes with every render (suitable when state/props changes style)
</div>
<div style={this.styleSheet.style1)>
styleSheet will only be auto-prefixed once on mount - more performant
</div>
<div style={this.styleSheet.style2.nested1)>
works also when nested
</div>
)
}
styleSheet: autoprefix({
style1:{
justifyContent: 'space-between',
overflow: 'auto',
flexShrink: 0
},
style2:{
nested1:{
display: 'flex',
width: 'calc(100% - 10px)'
}
}
})
})
By default, it will add prefixes only for the client's browser. When doing server rendering of a react page, you should add prefixes for every relevant browser. that's really easy -
var prefixedStyle = autoprefix(stylesObject, true);
// or - even easier, when requiring autoprefix, do this:
var autoprefix = require('autoprefix')(true);
$ npm install auto-prefixer --save
FAQs
react autoPrefixer
The npm package auto-prefixer receives a total of 237 weekly downloads. As such, auto-prefixer popularity was classified as not popular.
We found that auto-prefixer demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
Security News
A Stanford study reveals 9.5% of engineers contribute almost nothing, costing tech $90B annually, with remote work fueling the rise of "ghost engineers."
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.