• Stars
    star
    393
  • Rank 109,518 (Top 3 %)
  • Language
    JavaScript
  • License
    MIT License
  • Created over 9 years ago
  • Updated 5 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Autoprefixer for JavaScript style objects

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.

More Repositories

1

fela

State-Driven Styling in JavaScript
JavaScript
2,273
star
2

react-look

Advanced & Dynamic Component Styling for React and React Native. Ships with powerful Plugins, Mixins and Developer Tools. (Deprecated: use Fela)
JavaScript
583
star
3

react-layout-components

Layout Components for React based on Flexbox
JavaScript
337
star
4

react-controlled-form

React Forms with Zod Validation
TypeScript
118
star
5

react-css-component

Injecting CSS via React Components
JavaScript
94
star
6

alveron

Tiny (0.8kb) Elm-inspired state management for React
JavaScript
74
star
7

css-in-js-utils

Useful utility functions for CSS in JS solutions
TypeScript
74
star
8

bredon

A modern CSS value compiler in JavaScript
JavaScript
40
star
9

elodin

The Elodin Styling Language
JavaScript
30
star
10

fast-loops

Tiny (0.6kb), performant & immutable iteration utilities for arrays and objects
JavaScript
25
star
11

kilvin

Primitive React Layout Components using Fela
JavaScript
22
star
12

alveron-old

Opinionated Elm-inspired Redux Component Architecture for React
JavaScript
17
star
13

inline-style-prefix-all

Static Autoprefixer for inline styles
JavaScript
16
star
14

elodin-old

Quality and Optimisation tools for CSS in JavaScript
JavaScript
16
star
15

inline-style-expand-shorthand

Expanding shorthand properties in JavaScript style objects
JavaScript
13
star
16

brandeur

Convenience tool belt for css-hooks
JavaScript
12
star
17

small-color

Tiny (0.8kb), opinionated & tree-shakable alternative to color
JavaScript
7
star
18

small-date

Tiny (0.8kb) date formatting library with built-in i18n
JavaScript
6
star
19

tehlu

Component System for React and Brandeur
JavaScript
5
star
20

Calculate.js

Calculate.js is kind of an extension to the JavaScript build-in Math-Library.
JavaScript
5
star
21

ambrose

Configurable Design System Skeleton for React
JavaScript
5
star
22

react-markdown-github-renderers

react-markdown renderers for GitHub-like appearance
JavaScript
5
star
23

pogolookup

Ads-free, Privacy-first Pokemon Go Data Lookup & Analysis Fanpage
JavaScript
5
star
24

inline-style-transformer

Transformation tools for inline styles
JavaScript
5
star
25

lorren

A PDF Framework for React based on react-pdf
JavaScript
4
star
26

radium-plugin-prefix-all

Radium plugin that adds all vendor prefixes
JavaScript
4
star
27

react-create-keyframe

Helper to create and render keyframes on-demand in React
TypeScript
3
star
28

Obscene-UI

[Sass] Obscene UI is a responsive, mobile-friendly UI-Template to build stable and beautiful app themes
CSS
3
star
29

assign-styles

ES6 Object.assign() polyfill especially for inline-styles respecting !important notation
JavaScript
3
star
30

radium-plugin-linter

[devTool] Radium plugin that enables style linting with inline-style-linter
JavaScript
2
star
31

read-transform-write

Transform files with ease
JavaScript
2
star
32

doc-badges

Useful badges for Code & API documentation
2
star
33

theme-centric-component-design

Example for theme-centric component design
JavaScript
2
star
34

tokenize-sync

Simple synchronous string tokenizer using Regex
JavaScript
1
star
35

react-onegraph

React Bindings for OneGraph's Authentication Client
JavaScript
1
star
36

unitless-css-property

Helper to check for unitless CSS property names
JavaScript
1
star
37

rofrischmann

My personal portfolio webpage
HTML
1
star
38

speaking

Speaker resources and talk slides
JavaScript
1
star
39

flow-semantic-versioning

Enforced Semantic Versioning for Flow
JavaScript
1
star