inline-style-prefixer

Run-time Autoprefixer for JavaScript style objects

MIT 70 个版本
安装
npm install inline-style-prefixer
yarn add inline-style-prefixer
pnpm add inline-style-prefixer
bun add inline-style-prefixer
README

inline-style-prefixer

A small, simple and fast vendor prefixer from JavaScript style object.

npm downloads gzipped size npm version

Installation

yarn add inline-style-prefixer

If you're still using npm, you may run npm i --save inline-style-prefixer.

Browser Support

It supports all major browsers with the following versions. For other, unsupported browses, we automatically use a fallback.

  • Chrome: 55+
  • Android (Chrome): 55+
  • Android (Stock Browser): 5+
  • Android (UC): 11+
  • Firefox: 52+
  • Safari: 13+
  • iOS (Safari): 13+
  • Opera: 30+
  • Opera (Mini): 12+
  • IE: 11+
  • IE (Mobile): 11+
  • Edge: 12+

It will only add prefixes if a property still needs them in one of the above mentioned versions.
Therefore, e.g. border-radius will not be prefixed at all.

Need to support legacy browser versions?
Don't worry - we got you covered. Check this guide.

Usage

import { prefix } from 'inline-style-prefixer'

const style = {
  transition: '200ms all linear',
  boxSizing: 'border-box',
  display: 'flex',
  color: 'blue'
}

const output = prefix(style)

output === {
  WebkitTransition: '200ms all linear',
  transition: '200ms all linear',
  MozBoxSizing: 'border-box',
  boxSizing: 'border-box',
  display: [ '-webkit-box', '-moz-box', '-ms-flexbox', '-webkit-flex', 'flex' ],
  color: 'blue'
}

Usage with TypeScript

You can use TypeScript definition from DefinitelyTyped using @types/inline-style-prefixer

yarn add @types/inline-style-prefixer

# alternatively use npm
npm i --save @types/inline-style-prefixer

Documentation

If you got any issue using this prefixer, please first check the FAQ's. Most cases are already covered and provide a solid solution.

Community

Here are some popular users of this library:

PS: Feel free to add your solution!

Support

Join us on Gitter. We highly appreciate any contribution.
We also love to get feedback.

License

inline-style-prefixer is licensed under the MIT License.
Documentation is licensed under Creative Common License.
Created with ♥ by @rofrischmann and all contributors.

版本列表
7.0.1 2024-07-04
7.0.0 2022-11-16
6.0.4 2022-11-16
6.0.3 2022-11-16
6.0.2 2022-11-16
6.0.1 2021-09-28
6.0.0 2020-03-23
5.1.2 2020-02-13
5.1.1 2020-02-04
5.1.0 2019-04-04
5.0.4 2019-02-06
5.0.3 2018-10-28
5.0.2 2018-10-24
5.0.1 2018-09-05
5.0.0 2018-09-05
4.0.2 2018-05-09
4.0.0 2017-12-27
3.0.8 2017-09-17
3.0.7 2017-07-31
3.0.6 2017-06-13
3.0.5 2017-05-22
3.0.4 2017-05-22
3.0.3 2017-05-02
3.0.2 2017-03-13
3.0.1 2017-03-08
3.0.0 2017-02-17
2.0.5 2016-11-26
2.0.4 2016-09-16
2.0.3 2016-09-14
2.0.2 2016-09-14
2.0.1 2016-07-09
2.0.0 2016-07-02
1.0.4 2016-05-16
1.0.3 2016-03-23
1.0.2 2016-03-07
1.0.1 2016-03-01
1.0.0 2016-02-29
0.6.7 2016-01-26
0.6.6 2016-01-19
0.6.5 2016-01-18
0.6.4 2016-01-18
0.6.3 2016-01-09
0.6.2 2016-01-03
0.6.1 2016-01-03
0.6.0 2016-01-03
0.5.4 2015-12-03
0.5.3 2015-11-28
0.5.2 2015-11-24
0.5.1 2015-11-14
0.5.0 2015-11-12
0.4.0 2015-11-12
0.3.3 2015-10-09
0.3.2 2015-10-06
0.3.1 2015-10-06
0.3.0 2015-09-30
0.2.5 2015-09-25
0.2.4 2015-09-22
0.2.3 2015-09-22
0.2.2 2015-09-22
0.2.1 2015-09-22
0.2.0 2015-09-22
0.1.9 2015-09-21
0.1.8 2015-09-21
0.1.7 2015-08-20
0.1.6 2015-08-20
0.1.5 2015-08-19
0.1.4 2015-08-19
0.1.3 2015-08-19
0.1.2 2015-08-19
0.1.1 2015-08-16