Giter Club home page Giter Club logo

gulp-combine-media-queries's People

Contributors

khusseini avatar konitter avatar mikestreety avatar mozzymoz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

gulp-combine-media-queries's Issues

new error TypeError('must start with number, buffer, array or string')

wp-content/themes/projectname/scss/main.css found.
buffer.js:167
throw new TypeError('must start with number, buffer, array or string');
^

TypeError: must start with number, buffer, array or string
at fromObject (buffer.js:167:9)
at new Buffer (buffer.js:58:10)
at Transform.transform as _transform
at Transform._read (/Users/username/dev/projectname/node_modules/gulp-combine-media-queries/node_modules/readable-stream/lib/_stream_transform.js:184:10)
at Transform._write (/Users/username/dev/projectname/node_modules/gulp-combine-media-queries/node_modules/readable-stream/lib/_stream_transform.js:172:12)
at doWrite (/Users/username/dev/projectname/node_modules/gulp-combine-media-queries/node_modules/readable-stream/lib/_stream_writable.js:237:10)
at writeOrBuffer (/Users/username/dev/projectname/node_modules/gulp-combine-media-queries/node_modules/readable-stream/lib/_stream_writable.js:227:5)
at Transform.Writable.write (/Users/username/dev/projectname/node_modules/gulp-combine-media-queries/node_modules/readable-stream/lib/_stream_writable.js:194:11)
at DestroyableTransform.ondata (/Users/username/dev/projectname/node_modules/through2/node_modules/readable-stream/lib/_stream_readable.js:583:20)
at emitOne (events.js:77:13)
Segmentation fault: 11

Error property missing at gulp with stylus

I found this error...

C:\xampp\htdocs\web\project\node_modules\when\lib\decorators\unhandledRejection.js:80
                throw e;
                ^

Error: property missing ':' near line 2892:3
    at error (C:\xampp\htdocs\web\project\node_modules\gulp-combine-media-queries\node_modules\css-parse\index.js:57:15)
    at declaration (C:\xampp\htdocs\web\project\node_modules\gulp-combine-media-queries\node_modules\css-parse\index.js:1:33)
    at declarations (C:\xampp\htdocs\web\project\node_modules\gulp-combine-media-queries\node_modules\css-parse\index.js:9:19)
    at rule (C:\xampp\htdocs\web\project\node_modules\gulp-combine-media-queries\node_modules\css-parse\index.js:481:21)
    at rules (C:\xampp\htdocs\web\project\node_modules\gulp-combine-media-queries\node_modules\css-parse\index.js:103:56)
    at stylesheet (C:\xampp\htdocs\web\project\node_modules\gulp-combine-media-queries\node_modules\css-parse\index.js:736)
    at module.exports (C:\xampp\htdocs\web\project\node_modules\gulp-combine-media-queries\node_modules\css-parse\index.j485:10)
    at Transform.transform [as _transform] (C:\xampp\htdocs\web\project\node_modules\gulp-combine-media-queries\index.js:3:19)
    at Transform._read (C:\xampp\htdocs\web\project\node_modules\gulp-combine-media-queries\node_modules\readable-stream\b\_stream_transform.js:184:10)
    at Transform._write (C:\xampp\htdocs\web\project\node_modules\gulp-combine-media-queries\node_modules\readable-streamib\_stream_transform.js:172:12)

My gulpfile.js is:

const gulp = require('gulp'),
          mmq = require('gulp-combine-media-queries');

gulp.task('stylus', function(){
   gulp.src('APP/CSS/main.styl')
      .pipe(plumber())
      .pipe(stylus({
         use:[prefixer(), rupture(), jeet()],
         compress: false
     }))
      .pipe(mmq({log: true}))
      .pipe(gulp.dest('Assets/CSS/'))
      .pipe(browserSync.reload({stream:true}))
      .pipe(gulp.dest('APP/CSS'));
});

In package.json:

"devDependencies": {
    "gulp-combine-media-queries": "^0.2.0"
}

And I not found a solution for this.

Can you help me? please..

throw new TypeError(kFromErrorMsg);

TypeError: First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.
at Function.Buffer.from (buffer.js:202:9)
at new Buffer (buffer.js:158:17)
at Transform.transform [as _transform] (/var/www/xabar-html/node_modules/gulp-combine-media-queries/index.js:152:21)
at Transform._read (/var/www/xabar-html/node_modules/gulp-combine-media-queries/node_modules/readable-stream/lib/_stream_transform.js:184:10)
at Transform._write (/var/www/xabar-html/node_modules/gulp-combine-media-queries/node_modules/readable-stream/lib/_stream_transform.js:172:12)
at doWrite (/var/www/xabar-html/node_modules/gulp-combine-media-queries/node_modules/readable-stream/lib/_stream_writable.js:237:10)
at writeOrBuffer (/var/www/xabar-html/node_modules/gulp-combine-media-queries/node_modules/readable-stream/lib/_stream_writable.js:227:5)
at Transform.Writable.write (/var/www/xabar-html/node_modules/gulp-combine-media-queries/node_modules/readable-stream/lib/_stream_writable.js:194:11)
at Readable.ondata (_stream_readable.js:639:20)
at emitOne (events.js:116:13)

Increases file size?

Hey,

just included this plugin into one of my projects and found out it actually can increase file size instead of minimizing it?

I don’t know why exactly this happens and how to prevent it. Maybe you can add a flag/option that authors can use in their gulpfile to not increase filesize (and then skip the optimization after comparing filesizes)?

The Problem with gulp-util

https://medium.com/gulpjs/gulp-util-ca3b1f9f9ac5

request to remove gulp-util using the following API replacements:
gutil.File => https://www.npmjs.com/package/vinyl
gutil.replaceExtension => The .extname property on Vinyl objects or https://www.npmjs.com/package/replace-ext
gutil.colors => https://www.npmjs.com/package/ansi-colors
gutil.date => https://www.npmjs.com/package/date-format
gutil.log => https://www.npmjs.com/package/fancy-log
gutil.template => https://www.npmjs.com/package/lodash.template
gutil.env => https://www.npmjs.com/package/minimist
gutil.beep => https://www.npmjs.com/package/beeper
gutil.noop => https://www.npmjs.com/package/through2
gutil.isStream => Use the .isStream() method on Vinyl objects
gutil.isBuffer => Use the .isBuffer() method on Vinyl objects
gutil.isNull => Use the .isNull() method on Vinyl objects
gutil.linefeed => Use the string '\n' in your code
gutil.combine => https://www.npmjs.com/package/multipipe
gutil.buffer => https://www.npmjs.com/package/list-stream
gutil.PluginError => https://www.npmjs.com/package/plugin-error

can't handle nested media rules?

I have something like this

@media only screen and (max-width: 940px) {
  .test {
    background-color: red;
  }

  @media (min-resolution: 144dpi) {
    .test {
      background-color: green;
    }
  }
}

@media (min-resolution: 144dpi) {
  .test {
    background-color: yellow;
  }
}

but this gets converted to

@media (min-resolution: 144dpi) {
  .test {
    background-color: yellow;
  }
}

@media only screen and (max-width: 940px) {
  .test {
    background-color: red;
  }
}

so I'll lose my nested media rules :(

Bug with url @import

Hi!
There is a bug with @imports.
Example file style.less:

@import url(http://fonts.googleapis.com/css?family=Titillium+Web:600);

and nothing happens, output is empty.

Gulp task I'm using:

gulp.task('style', function () {
    gulp.src(source.css + '/style.less')
        .pipe(less({ sourceMap: true }))
            .on('error', gutil.log)
            .pipe(gulp.dest(assets.css))
            .pipe(browserSync.reload({ stream: true }))
        .pipe(rename({ suffix: '.min' }))
        .pipe(less())
            .on('error', gutil.log)
        .pipe(cmq())
        .pipe(csso())
            .pipe(gulp.dest(assets.css))
});

In style.css @imports exists, but in style.min.css @imports ripped out.
If I comment .pipe(cmq()) β€” @imports comes back.

Add source map support

I love the idea here, but I've put a lot of effort into ensuring my source maps work properly. And unfortunately this plugin does not handle them. It throws the media query styles after any source map info right now (the bottom of the file).

For the record, from my tests, the plugin works as expected. For now, I'm just going to move this to a final production build step.

Some thoughts on where to go with this... https://github.com/ai/autoprefixer currently handles this situation. They get CSS piped to them, they look for current source maps, then modify the source map depending on what changes autoprefixer makes, then re-inline the source map. It looks like the author even made a library to help post process css: https://github.com/ai/postcss. Maybe you could leverage his efforts there to make your life easier?

And I found your plugin from this post from yeoman by Addy Osmani. So you may be picking up some more traction.

Error not catched in css-parse

When css-parse encounters an error it throws a new Error object which is not caught in index,js:125

This causes the watch workflow in Gulp to crash due to an unhandled error and is also resulting the .on('error') event not to be triggered.

Please look at some options to catch the error and throw a PluginError instead?

Feature request: exclude breakpoints with use_external

It would be nice to be able to exclude certain breakpoints when exporting to an external file.

Example use:
In [src].css I want to combine media queries for mobile landscape (eg. up to 40em), but don't want them to be exported in a separate file. Whereas [src].responsive.css would only contain media queries for tablet and desktop (40em and up).

The why here is Mobile First, where tablet & desktop styling is being served as a separate file. The plugin already does a great job at facilitating this workflow, but I'd hate to give up styling mobile landscape...

Broke sequence

I have some strange behavior after combining queries. Look at those images:

  • before combine:
    2016-11-16_152531
  • after:
    2016-11-16_152922

See the sequence has broken. My task is:

gulp.task('sass', function() {
  return gulp.src('sass/**/*.s+(a|c)ss')
    .pipe(sass())
    .pipe(cmq())
    .pipe(gulp.dest('css'))
});

Why this can be? I don't know what I'm doing wrong.

pseudo content: ""

empty pseudo content gets a space added. Dealbreaker for me unfortunately (pretty cool otherwise!)

content: "";

becomes

content: " ";

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.