https://github.com/devinus/html-autoprefixer
Autoprefix all CSS inside an html page - CSS inside style tags and inside style attributes.
https://github.com/devinus/html-autoprefixer
Last synced: 7 months ago
JSON representation
Autoprefix all CSS inside an html page - CSS inside style tags and inside style attributes.
- Host: GitHub
- URL: https://github.com/devinus/html-autoprefixer
- Owner: devinus
- Created: 2014-12-03T17:49:34.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2022-09-26T01:55:37.000Z (over 3 years ago)
- Last Synced: 2025-10-08T23:33:44.199Z (8 months ago)
- Language: JavaScript
- Size: 30.3 KB
- Stars: 55
- Watchers: 8
- Forks: 13
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# html-autoprefixer

Autoprefix all CSS inside an html page - CSS inside style tags and inside style attributes.
[](https://travis-ci.org/Rebelmail/html-autoprefixer)
[](http://badge.fury.io/js/html-autoprefixer)
```javascript
var prefixed = htmlAutoprefixer.process(htmlString);
```
## Installation
```
npm install html-autoprefixer --save
```
## Usage
You pass an html string to `.process` and it returns the processed html.
```javascript
var htmlAutoprefixer = require("html-autoprefixer");
var htmlString = ":fullscreen a { transition: transform 1s; }
Hello
";
var prefixed = htmlAutoprefixer.process(htmlString);
```
You can optionally pass [cheerio options](https://github.com/cheeriojs/cheerio#loading).
```javascript
var htmlString = "";
var prefixed = htmlAutoprefixer.process(htmlString, { lowerCaseTags: true } );
//
```
### Gulp
[](https://github.com/RebelMail/gulp-html-autoprefixer)
Using [Gulp](http://gulpjs.com)? Use [gulp-html-autoprefixer](https://github.com/RebelMail/gulp-html-autoprefixer).
```javascript
var gulp = require( "gulp" );
var htmlAutoprefixer = require( "gulp-html-autoprefixer" );
gulp.task( "html-autoprefix", function( ) {
return gulp.src( "./path/to/index-or-other.html" )
.pipe( htmlAutoprefixer( ) )
.pipe( gulp.dest( "dist" ) );
} );
```
## Contributing
1. Fork it
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Added some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create new Pull Request
## Running tests
```
npm install
npm test
```