Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Look at posthtml-postcss + postcss plugins :) #3

Open
voischev opened this issue Dec 28, 2015 · 3 comments
Open

Look at posthtml-postcss + postcss plugins :) #3

voischev opened this issue Dec 28, 2015 · 3 comments

Comments

@voischev
Copy link
Contributor

https://github.com/posthtml/posthtml-postcss
https://github.com/cuth/postcss-pxtorem

@hzlzh
Copy link
Member

hzlzh commented Dec 29, 2015

We are using https://github.com/cuth/postcss-pxtorem in our gulp workflow now, so I made this posthtml-px2rem for HTML output use.

@voischev
Copy link
Contributor Author

gulp.task('html', function() {
    var posthtml = require('gulp-posthtml');
    return gulp.src('src/**/*.html')
        .pipe(posthtml([ require('posthtml-postcss')([
            require('postcss-pxtorem')
            /* other postcss plugins */
        ]/*, postcssOptionsObj */) ]))
        .pipe(gulp.dest('build/'));
});

should make equal result for HTML

@chenkun24
Copy link

posthtml-px2rem has some issues rather than postcss-pxtorem, for example, media query option. So if there are some css styles in html (not inline-style), it seems better to use posthtml-postcss+postcss-pxtorem instead. If there are only inline-styles in HTML, posthtml-px2rem can handle.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants