• Stars
    star
    162
  • Rank 232,284 (Top 5 %)
  • Language
    JavaScript
  • License
    MIT License
  • Created about 12 years ago
  • Updated about 6 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Minify CSS files with CSSO.

grunt-csso Build Status Dependency Status

Minify CSS files with CSSO.

CSSO task

Run this task with the grunt csso command.

Task targets, files and options may be specified according to the grunt Configuring tasks guide.

Files are compressed with csso.

Options

restructure

Type: Boolean
Default: true

You can turns structural optimizations off.

banner

Type: String
Default: null

Prefix the compressed source with the given banner, with a linebreak inbetween.

report

Choices: false, true, 'min', 'gzip'
Default: false

Either report only minification result or report minification and gzip results. This is useful to see exactly how well clean-css is performing but using 'gzip' will make the task take 5-10x longer to complete. Example output.

beforeCompress

Type: (ast, options, csso) => {}, [(ast, options, csso) => {}]
Default: null

Allows registering one or many beforeCompress functions. This is useful to add manipulate the AST before compression is made by csso.

afterCompress

Type: (ast, options, csso) => {}, [(ast, options, csso) => {}]
Default: null

Allows registering one or many afterCompress functions. This is useful to add manipulate the AST after compression is made by csso.

Usage Examples

csso: {
  compress: {
    options: {
      report: 'gzip'
    },
    files: {
      'output.css': ['input.css']
    }
  },
  restructure: {
    options: {
      restructure: false,
      report: 'min'
    },
    files: {
      'restructure.css': ['input.css']
    }
  },
  banner: {
    options: {
      banner: '/* Copyleft */'
    },
    files: {
      'banner.css': ['input.css']
    }
  },
  shortcut: {
    src: 'override.css'
  }
}

Minify all contents of a release directory and add a .min.css extension

csso: {
  dynamic_mappings: {
    expand: true,
    cwd: '/css/',
    src: ['*.css', '!*.min.css'],
    dest: 'dest/css/',
    ext: '.min.css'
  }
}

More Repositories

1

stylestats

StyleStats is a library to collect CSS statistics.
CSS
1,835
star
2

material-design-color-palette

Sketch app plugin for displaying 2014 Material Design color palettes
JavaScript
559
star
3

maple

A better front-end boilerplate.
CSS
168
star
4

wisteria

The best HTML-driven prototyping tool for designing in browser.
CSS
52
star
5

webpagetest-doc-ja

WebPagetest Documentation in Japanese.
38
star
6

speed

Make the Web Faster!
CSS
36
star
7

licecap-icon

A better icon for LICEcap.
24
star
8

gaer

A CLI for Google Analytics Event Tracking Report.
JavaScript
22
star
9

Nyars

Appcelerator Titanium Mobile Project.
JavaScript
17
star
10

sublime-text-icon

A replacement icon for Sublime Text 2 and Sublime Text 3
10
star
11

jsoff

A chrome extension to disable JavaScript with one click.
JavaScript
8
star
12

mol

More or Less.
HTML
8
star
13

Coda-Completion-for-jQuery-Mobile

7
star
14

generator-maple

A generator for Maple project
JavaScript
6
star
15

grunt-scandium

This is a half-baked grunt plugin for titanium command line.
JavaScript
6
star
16

dotfiles

わい、黒い画面の向こうに行ってみたいねんっ!
Vim Script
4
star
17

gFaceee

A Chrome Extension for better GitHub UI.
JavaScript
3
star
18

ATND-Manager

Enhance atnd.org.
JavaScript
3
star
19

gulp-define-golang-template

Gulp extension to define a golang template.
JavaScript
2
star
20

grunt-init-maple

Create a basic maple project with grunt-init.
JavaScript
2
star
21

test

Don't Guess it, Test it!
CSS
2
star
22

packs

2
star
23

sample-qiita-material-design

HTML
2
star
24

tumblrtouch

JavaScript
1
star
25

static

Hosted static resource.
HTML
1
star
26

t32k

Config files for my GitHub profile.
1
star
27

kanazawajs

My first memorial community.
1
star
28

hello-ecmascript

You might not need CoffeeScript and Lodash :)
JavaScript
1
star
29

sample_spriting_with_compass

Ruby
1
star
30

t32k.github.io

HTML
1
star
31

octocat-clerk

1
star
32

Meta-Checker

Display title element, meta elements(description, keywords), and count characters.
JavaScript
1
star
33

slides

HTML
1
star