An express middleware which cleans all the unused css in the template and makes the css slick
MIT License
No more bloated CSS styles 💩 in your websites.
npm install express-slick-css --save
...
<!-- rel='stylesheet' must be there otherwise it won't be picked up -->
<link href='/stylesheets/style.css' rel='stylesheet'>
...
const slickify = require('express-slick-css');
...
app.use(slickify(options));
...
app.use('/', indexRoutes);
Options | Description | Mandatory | Default Value |
---|---|---|---|
outputPath | path to save the new slick stylesheets | Yes | N/A |
cssPath | path to look for stylesheets specified in link tag | No | outputPath |
publicPath | public path for serving css asset eg. href="/css/style.css"
|
No | '/' |
uncssOptions | Supports all the options provided by uncss | No | Refer uncss |
app.use(
slickify({
cssPath: path.join(__dirname, 'css'),
// outputPath must exists
// Add the outputPath to .gitignore if you want
outputPath: path.join(__dirname, 'slick-css'),
publicPath: '/stylesheets/',
uncssOptions: {
// Include global CSS frameworks here to keep it clean
stylesheets : ['lib/bootstrap/dist/css/bootstrap.css']
}
});
);
Feel free to create an issue for a feature request, bug and you can take up any of those to make a pull request
Show your support by ⭐ the repo
MIT Ameer Jhan