Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/robinweser/inline-style-prefixer
Autoprefixer for JavaScript style objects
https://github.com/robinweser/inline-style-prefixer
autoprefixer css cssinjs legacy-support vendor-prefix
Last synced: 14 days ago
JSON representation
Autoprefixer for JavaScript style objects
- Host: GitHub
- URL: https://github.com/robinweser/inline-style-prefixer
- Owner: robinweser
- License: mit
- Created: 2015-08-12T11:17:26.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2022-12-07T21:12:40.000Z (almost 2 years ago)
- Last Synced: 2024-05-02T00:01:24.772Z (6 months ago)
- Topics: autoprefixer, css, cssinjs, legacy-support, vendor-prefix
- Language: JavaScript
- Homepage: https://inline-style-prefixer.js.org
- Size: 2.9 MB
- Stars: 392
- Watchers: 7
- Forks: 70
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: .github/CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
# inline-style-prefixer
A small, simple and fast vendor prefixer from JavaScript style object.
## Installation
```sh
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](https://github.com/rofrischmann/inline-style-prefixer/blob/master/docs/guides/CustomPrefixer.md).## Usage
```javascript
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](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/inline-style-prefixer) using [@types/inline-style-prefixer](https://www.npmjs.com/package/@types/inline-style-prefixer)
```sh
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.
- [Usage Guides](https://inline-style-prefixer.js.org/docs/UsageGuides.html)
- [Data Reference](https://inline-style-prefixer.js.org/docs/DataReference.html)
- [API Reference](https://inline-style-prefixer.js.org/docs/API.html)## Community
Here are some popular users of this library:
- [Aphrodite](https://github.com/Khan/aphrodite)
- [Fela](https://github.com/rofrischmann/fela)
- [Glamor](https://github.com/threepointone/glamor)
- [Material UI](https://github.com/callemall/material-ui)
- [nano-css](https://github.com/streamich/nano-css)
- [Radium](https://github.com/FormidableLabs/radium)
- [react-native-web](https://github.com/necolas/react-native-web)
- [styled-components](https://github.com/styled-components/styled-components)
- [Styletron](https://github.com/rtsao/styletron)> PS: Feel free to add your solution!
## Support
Join us on [Gitter](https://gitter.im/rofrischmann/fela). We highly appreciate any contribution.
We also love to get feedback.## License
**inline-style-prefixer** is licensed under the [MIT License](http://opensource.org/licenses/MIT).
Documentation is licensed under [Creative Common License](http://creativecommons.org/licenses/by/4.0/).
Created with ♥ by [@rofrischmann](http://rofrischmann.de) and all contributors.