-
Book Overview & Buying
-
Table Of Contents
LESS WEB DEVELOPMENT COOKBOOK
By :
When your project grows or when you are using CSS frameworks, such as Bootstrap, your compiled CSS code can contain many selectors that are never used. This unused CSS code will have a negative effect on the performance of your website. The unused CSS plugin can remove this unused selector from your CSS code.
The only requirement for this recipe is to have the unused CSS plugin installed and loaded in your Gruntfile.js file. If you have not installed this plugin in the Installing Grunt plugins recipe of this chapter, you can do so using the following command in the root of your project:
$ npm install grunt-uncss –save-dev
You can add the following configuration for the watch task to your Gruntfile.js file:
uncss: {
dist: {
files: {
'css/style.css' : ['index.html']
}
}
}The preceding code only checks the index.html file for unused selectors. You can add a list of...
Change the font size
Change margin width
Change background colour