Inline images in CSS

Because this commit’s parent added a few new images, we are now serving at
least a handful of images, therefore a few additional HTTP requests. It’s better
to combine multiple HTTP requests into one for performance reasons (up to a
point).

This commit adds an extra step to the preprocessing of SASS files which takes
any images it finds, base64 encodes them and inlines them into the distributed
CSS files.

It also modifies the content security policy to allow inline images.
This commit is contained in:
Chris Hill-Scott
2016-02-20 14:11:33 +00:00
parent 17b99c9bf2
commit fd54eeaeb7
4 changed files with 4 additions and 2 deletions

View File

@@ -62,6 +62,7 @@ gulp.task('sass', () => gulp
paths.npm + 'govuk_frontend_toolkit/stylesheets/'
]
}))
.pipe(plugins.base64({baseDir: 'app', debug: true}))
.pipe(gulp.dest(paths.dist + '/stylesheets'))
);