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

Use files from stream instead of parsing the document #21

Open
thasmo opened this issue Mar 18, 2015 · 0 comments
Open

Use files from stream instead of parsing the document #21

thasmo opened this issue Mar 18, 2015 · 0 comments
Labels

Comments

@thasmo
Copy link

thasmo commented Mar 18, 2015

I'd love to use something like this:

gulp.src(['index.html', 'styles/*.css'])
    .pipe(if('*.html', inlineCss({
        parse: false,
        stream: '*.css'
    })))

Which would just use all CSS files from the stream and it would not parse the template.

Currently I'm trying something like this which of course doesn't work:

gulp.task('templates', function() {
    var assets = useref.assets();

    return gulp.src('source/template/*.jade')
        .pipe(jade()) // Compile the templates to HTML
        .pipe(assets) // Find referenced stylesheets
        .pipe(assets.restore()) // Restore HTML file
        .pipe(if('*.scss', sass())) // Compile SASS to CSS
        .pipe(if('*.html', inlineCss())) // Inline stylesheets
        .pipe(gulp.dest('public/')); // Write HTML files to destination
});

Basically I want to get referenced SASS files from within the templates, compile them to CSS and apply them to the template using gulp-inline-css without creating temporary files.

Is there any way to do this right now? Would be nice to have this feature and use it as easy as possible!

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

No branches or pull requests

2 participants