Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/foolishchow/gulp-no-css-media
remove unused css media condition
https://github.com/foolishchow/gulp-no-css-media
Last synced: 5 days ago
JSON representation
remove unused css media condition
- Host: GitHub
- URL: https://github.com/foolishchow/gulp-no-css-media
- Owner: foolishchow
- License: mit
- Created: 2017-03-17T05:56:10.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2017-03-17T06:13:53.000Z (over 7 years ago)
- Last Synced: 2024-10-12T04:24:45.829Z (about 1 month ago)
- Language: JavaScript
- Size: 2.93 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# gulp-no-css-media
remove unused css media condition
> purpose
Sometimes I use some frameworks contains responsive media .
but I don't need to use in my production enviroment.
So before publish , I prefer to remove them from my project .
so there is this module.> useage
```javascript
var gulp = require('gulp'),
noCssMedia = require('gulp-no-css-media');
gulp.task('bootstrap',function(){
var leftOpt = ['(min-width: 1200px)','(min-width: 768px)'];
//编译bootstrap样式并去除响应式代码,由于会影响sourceMap,所以本地调试时建议不去除@Media
gulp.src('./src/static/bootstrap.css')
.pipe(noCssMedia(leftOpt))
.pipe(gulp.dest('./src/static/style/'));
});
```
it will remove all the `@media` condition in your file.
so you can config those medias you want to left.
just config then to an Array.
```javascript
var leftOpt = ['(min-width: 1200px)','(min-width: 768px)'];
noCssMedia(leftOpt)
```have fun