Giter Club home page Giter Club logo

grunt-stripmq's Issues

imports getting stripped out

I noticed that stripmq is not including the _@_import statements in the generated files. Is there any way to include _@_imports?

can not get stripmq to work for multiple src dest folder

Hi,
it seems there is an issue to get stripmq working for multiple folders.
This works:

        files: {
            expand: true,
            cwd: '.tmp/resources/css/',
            src: '{,*/}*.css',
            dest: '.tmp/resources/css/',
            ext: '.mqless.css'
        }

This one not:

        files: {
            expand: true,
            cwd: '.tmp/',
            src: ['resources/css/{,*/}*.css' , 'resources/css2/{,*/}*.css'],
            dest: '.tmp/resources/css/',
            ext: '.mqless.css'
        }

is there a solution for multiple folders setup?

"opacity" IE 8 issue

Hi,

I have installed this plugin in my project, It does not replace "opacity" css.

Thank you

issue: do not merge CSS rules!

hello some logic in the script merges css rules!
for example if i have that:
.test1 {
margin: 0;
}
.test2 {
margin: 0;
}

it is this after stripmq is done:
.test1,
.test2 {
margin: 0;
}

and i dont want that merging it breaks my website :(
is there an option to stop stripmq doing this? or do you have a fix for it?

edit:
i have seen thats an clean-css option.

StripMQ to separate package

Maybe move the tasks/lib/stripmq file to a separate npm package so it can be used for grunt/gulp/broccoli etc.

Compressed/expanded output

As far as I can see, the output of stripmq is always compressed. Shouldn't there be an option to have it expanded, e.g. for checking the generated output in development?

I, for example, usually use Sass's nested style for development and compressed for deployment. (Yes, I am aware that most editors can re-format CSS to that, but that's manually. I am lazy. ;-))

LICENSE?

you need to include the license text for MIT somewhere

Getting "path must be a string" error

Trying to run:

stripmq: {
        all: {
            files: {
                'css/all/404.css': ['css/all/test/404.css']
            }
        }
    }

However I keep on getting

Warning: path must be a string Use --force to continue.

I think it's a path issue, but I am not able to resolve it. Any help would be greatly appreciated.

Media queries with `only` should be ignored for IE8

From the Media Query Spec:

The keyword ‘only’ can also be used to hide style sheets from older user agents. User agents must process media queries starting with ‘only’ as if the ‘only’ keyword was not present.

So basically, if a media query contains only, it should be ignored in old IE. I added a related issue in css-mediaquery to reveal only in the AST. Once that happens, I can send a PR that checks for only, and clears up this issue.

Make it clearer what width and height options do

I had no idea what these did until I started playing with the task. If set to 1024 (the default) it will ignore any media queries wider than that, is that correct?

If so I would recommend updating the README.md to make this clearer. Happy to submit a PR if necessary.

Cheers

Support IE9/10 media hack?

Trying to use an IE9/10 specific @media screen and (min-width:0\0) hack (see "Moving IE specific hacks into media blocks") but StripMQ (what we use for IE8 support) is exiting with an error:

{ [Error: Stripping media queries failed.] origError: [TypeError: Cannot read property '1' of null] }

Would it be possible to support this weird hack? As a result, we'll have to degrade IE9/10 so that StripMQ can still work, but ideally StripMQ would maybe just ignore media queries it doesn't understand?

I think I lifted this hack from http://wtfforms.com: https://github.com/mdo/wtf-forms/blob/master/wtf-forms.css#L186-L212

Thanks!

Generate a diff File

StripMQ is more or less a blackbox. Some other grunt Plugins like autoprefixer are able to generate diff files or a log to see and control what has been done during the process. would be very nice if stripmq can do something similar

Concat of files over a folder does not work

A setup like this works fine with the "contrib-cssmin" task:

{
    "portal":
    {
        "files":
        {
            "../../../httpdocs/module/portal/css/ie_old.css":
                [
                    "../../../httpdocs/module/portal/css/*.css"
                ]
        }
    }
}

But your task fails to concat multiple files into one, it just takes the first one and finally aborts the process.

Note: the css file containts mixed CSS, like:

.box {
    border: 1px solid;
}

@media screen and (min-width: 59.999em) {
    .box{
        display: inline-block;
    }
}

Best regards

Advanced optimisations should be disabled for CleanCss component

Some the optimisations in CleanCss can break stylesheets for IE8, for example the merging of background-size properties into the main background declaration. This sucks, as generating IE8 stylesheets is what I assume this component is mainly used for!

CleanCss also has a "compatibility" mode, which would disable optimisations that would break old IEs, so it might be helpful to use that by default, rather than having to disable CleanCss completely, as it is otherwise quite useful.

Include multiple types

I usually include print styles at the end of my CSS files using @media print {}. If I use

options: {
    width: 1024,
    type: 'screen'
},

the generated output file does not include said print styles. That's logical, because they're obviously not screen styles. But it's not very convenient.

Is there a way to include multiple types? If so, I did not get how to do that from the README. (Which might be possible, I'm not a Grunt expert.) If not, maybe there should be. :)

Missing comma in Grunt Task example code

Not sure if this is maintained anymore but there's a missing comma after the closing brace for options in the grunt task example. It should be:

    stripmq: {
        options: {
            width: 640,     // viewport width, default is 1024
            height: 480,    // viewport height, default is 768
            'device-pixel-ratio': 2          // default is 1
        },
        all: {
            files: {
                'desktop.css': ['mobile-first.css']
            }
        }
    }

Multiple values in width option

Hi,

is it possible to set multiple values in the width options? I need this, because the desktop styles are in different media query sizes.

Cheers Philip

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.