Checks if all images in a local CSS file exists
css-image-checker can check CSS files for invalid referenced images
npm install -g css-image-checker
css-image-checker --folder '/www-folder'
Consider the following code:
#logo a {
background: url(logo.png) no-repeat -42px -271px;
}
but you only have logo.jpg
image available.
Running css-image-checker --folder '/www-folder'
The output will be:
Error found in: style.css
Full path not found: /www-folder/logo.png
Path in CSS file: logo.png
Number of errors: 1
0 = No errors
1 = Errors were founds in the CSS files
2 = No folder were specified on command line
3 = Folder specified does not exists
4 = Folder specified is not a folder
css-image-checker can be used in CI environments to check your CSS files before merging a pull request