<commit_before># Combine media queries

> Combine matching media queriries into one media query definition. Useful for CSS generated by CSS preprocessors using nested media queries written mobile-first.

This was written as a solution to a problem we have using LESS CSS for our mobile first sites.

## Getting Started
This plugin requires Grunt `~0.4.1`

If you haven't used [Grunt](http://gruntjs.com/) before, be sure to check out the [Getting Started](http://gruntjs.com/getting-started) guide, as it explains how to create a [Gruntfile](http://gruntjs.com/sample-gruntfile) as well as install and use Grunt plugins. Once you're familiar with that process, you may install this plugin with this command:

```shell
npm install grunt-combine-media-queries --save-dev
```

Once the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:

```js
grunt.loadNpmTasks('grunt-combine-media-queries');
```

## The "cmq" task

### Overview
In your project's Gruntfile, add a section named `cmq` to the data object passed into `grunt.initConfig()`.

```js
grunt.initConfig({
  cmq: {
    your_target: {
      // Target-specific file lists and/or options go here.
    },
  },
})
```

### Options

Currently there aren't any options

### Usage Examples

#### Default Options
In this example, all the css files in `test` are processed, minified and moved to the folder `tmp` with a file extension of '.min.css'

```js
grunt.initConfig({
  cmq: {
    options: {
      report: 'min',
      ext: '.min.css',
      log: false
    },<commit_msg>Updated README.md to include information about options<commit_after># Combine media queries

> Combine matching media queriries into one media query definition. Useful for CSS generated by preprocessors using nested media queries written mobile-first. Minifies CSS by default.

This was written as a solution to a problem we have using LESS CSS for our mobile first sites.

## Getting Started
This plugin requires Grunt `~0.4.1`

If you haven't used [Grunt](http://gruntjs.com/) before, be sure to check out the [Getting Started](http://gruntjs.com/getting-started) guide, as it explains how to create a [Gruntfile](http://gruntjs.com/sample-gruntfile) as well as install and use Grunt plugins. Once you're familiar with that process, you may install this plugin with this command:

```shell
npm install grunt-combine-media-queries --save-dev
```

Once the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:

```js
grunt.loadNpmTasks('grunt-combine-media-queries');
```

## The "cmq" task

### Overview
In your project's Gruntfile, add a section named `cmq` to the data object passed into `grunt.initConfig()`.

```js
grunt.initConfig({
  cmq: {
    your_target: {
      // Target-specific file lists and/or options go here.
    },
  },
})
```

### Options

#### report
Choices: `false`, `'min'`, `'gzip'`
Default: `false`

Either do not report anything, report only minification result, or report minification and gzip results.
Using `'gzip'` will make the task take 5-10x longer to complete.

Example ouput using `'gzip'`:

```
Original: 198444 bytes.
Minified: 101615 bytes.
Gzipped:  20084 bytes.
```

#### log

Type: `boolean`
Default: `false`

Get an overview of the processed media queries in the log.

### Usage Examples

#### Default Options
In this example, all the css files in `test` are processed, minified and moved to the folder `tmp` with a file extension of '.min.css'

```js
grunt.initConfig({
  cmq: {
    options: {
      report: 'min',
      log: false
    },
{'fraction_non_alphanumeric': 0.1067556296914095, 'fraction_numerical': 0.007228245760355852, 'mean_word_length': 4.01813110181311, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2154243', 'n_tokens_mistral': 1117, 'n_tokens_neox': 1057, 'n_words': 458}