PHPackages                             vladkens/autoprefixer - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. vladkens/autoprefixer

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

vladkens/autoprefixer
=====================

Run Autoprefixer using node.js in you php.

v0.1(11y ago)76333.5k↓31%13[5 issues](https://github.com/vladkens/autoprefixer-php/issues)[5 PRs](https://github.com/vladkens/autoprefixer-php/pulls)3MITCSSPHP &gt;=5.3.0

Since Jan 30Pushed 2y ago7 watchersCompare

[ Source](https://github.com/vladkens/autoprefixer-php)[ Packagist](https://packagist.org/packages/vladkens/autoprefixer)[ RSS](/packages/vladkens-autoprefixer/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)DependenciesVersions (2)Used By (3)

Autoprefixer PHP [![Build Status](https://camo.githubusercontent.com/da4109d1cedf5b4c66751da4eb1a149067847caad32a99275c58c2add6ecec21/68747470733a2f2f7472617669732d63692e6f72672f766c61646b656e732f6175746f70726566697865722d7068702e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/vladkens/autoprefixer-php)
===========================================================================================================================================================================================================================================================================================================================

[](#autoprefixer-php-)

[Autoprefixer](https://github.com/ai/autoprefixer) is a tool to parse CSS and add vendor prefixes to CSS rules using values from the [Can I Use](http://caniuse.com/). This library provides PHP integration with [Node.js](http://nodejs.org/) application.

Write your CSS rules without vendor prefixes (in fact, forget about them entirely):

```
$autoprefixer = new Autoprefixer();
$css      = 'a { transition: transform 1s }';
$prefixed = $autoprefixer->compile($css);
```

Autoprefixer uses the data on current browser popularity and properties support to apply prefixes for you:

```
a {
  -webkit-transition: -webkit-transform 1s;
  transition: -ms-transform 1s;
  transition: transform 1s
}
```

You can ask me any questions by e-mail:

Install
-------

[](#install)

- First you need install [Node.js](http://nodejs.org/) in your server.

### Install via Composer.

[](#install-via-composer)

- Create a composer.json file in your project root:

    ```
    {
        "require": {
            "vladkens/autoprefixer": "dev-master"
        }
    }
    ```
- Write in the project root:

    Linux: `php composer.phar install`

    Windows: `composer.bat install`
- In `index.php` write:

    ```
    require_once 'vendor/autoload.php';
    ```

Usage
-----

[](#usage)

```
$autoprefixer = new Autoprefixer();
$css_one = 'a { color: black; }';
$css_two = 'a { color: white; }';

// If need compile one css. Function return compied CSS.
$prefixed = $autoprefixer->compile($css_one);
echo $prefixed;

// If need compile many css in one time. Function return array of compiled CSS.
$prefixed = $autoprefixer->([$css_one, $css_two]);
echo $prefixed[0] . "\n" . $prefixed[1];

// If occurred error in compile time Autoprefixer throw exception named `AutoprefixerException`.
// You need process it.
try {
    $autoprefixer->compile($css_one);
} catch (AutoprefixerException $error) {
    echo $error->getMessage();
} catch (Exception $error) {
    echo $error->getMessage();
}

// If you want to choose specific browsers
$autoprefixer = new Autoprefixer('last 1 version'); // one rule
// or
$autoprefixer = new Autoprefixer(['ff > 2', '> 2%', 'ie 8']); // many rules
// or
$autoprefixer->setBrowsers('last 1 version');
// or change browsers on a one iteration
$autoprefixer->compile($css_one, 'last 1 version');

// Also, you can get latest version Autoprefixer using
$autoprefixer->update();
```

Speed
-----

[](#speed)

On my Intel i5-3210M 2.5GHz and HDD 5200 RPM GitHub styles compiled in 390 ms.

License
-------

[](#license)

[MIT](https://raw.github.com/vladkens/autoprefixer-php/master/LICENSE)

More docs
---------

[](#more-docs)

See

###  Health Score

37

—

LowBetter than 83% of packages

Maintenance19

Infrequent updates — may be unmaintained

Popularity48

Moderate usage in the ecosystem

Community22

Small or concentrated contributor base

Maturity48

Maturing project, gaining track record

 Bus Factor2

2 contributors hold 50%+ of commits

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

4127d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/825754?v=4)[vladkens](/maintainers/vladkens)[@vladkens](https://github.com/vladkens)

---

Top Contributors

[![cyrusboadway](https://avatars.githubusercontent.com/u/1457501?v=4)](https://github.com/cyrusboadway "cyrusboadway (1 commits)")[![vladkens](https://avatars.githubusercontent.com/u/825754?v=4)](https://github.com/vladkens "vladkens (1 commits)")[![Yonn-Trimoreau](https://avatars.githubusercontent.com/u/5746666?v=4)](https://github.com/Yonn-Trimoreau "Yonn-Trimoreau (1 commits)")

---

Tags

cssnodejsautoprefixerprefixes

### Embed Badge

![Health badge](/badges/vladkens-autoprefixer/health.svg)

```
[![Health](https://phpackages.com/badges/vladkens-autoprefixer/health.svg)](https://phpackages.com/packages/vladkens-autoprefixer)
```

###  Alternatives

[components/flag-icon-css

A curated collection of all country flags in SVG — plus the CSS for easier integration.

12.0k1.6M23](/packages/components-flag-icon-css)[matthiasmullie/minify

CSS &amp; JavaScript minifier, in PHP. Removes whitespace, strips comments, combines files (incl. @import statements and small assets in CSS files), and optimizes/shortens a few common programming patterns.

2.0k30.5M336](/packages/matthiasmullie-minify)[scssphp/scssphp

scssphp is a compiler for SCSS written in PHP.

62827.7M220](/packages/scssphp-scssphp)[mexitek/phpcolors

A series of methods that let you manipulate colors. Just incase you ever need different shades of one color on the fly.

5003.6M18](/packages/mexitek-phpcolors)[wikimedia/less.php

PHP port of the LESS processor

12327.4M77](/packages/wikimedia-lessphp)[cerdic/css-tidy

CSSTidy is a CSS minifier

2092.0M6](/packages/cerdic-css-tidy)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
