-
Notifications
You must be signed in to change notification settings - Fork 1
/
README.txt
125 lines (95 loc) · 2.67 KB
/
README.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
CSS Compressor
Version 1.0 (8th March 2009)
Copyright 2009, Andy Roberts
http://www.andy-roberts.net/software/csscompressor
Introduction
============
CSS Compressor is a simple Java library and utility for reducing the size
of Cascading Style Sheets (CSS).
This code is forked from Yahoo's YUI Compressor, an excellent open source
library for shrinking Javascript and CSS. I've made a number of enhancements to
the CSS compression algorithms. Hopefully one day in the future my changes will
be merged in to the YUI source. In the meantime, I wanted to share my code,
hence this distribution of this stand-alone CSS component.
Features
========
CSS Compressor specific
* Merges duplicate templates. E.g.
.myclassA
{
font-style: bold;
}
.myclassB
{
font-style: bold;
}
becomes:
.myclassA, .myclassB
{
font-style: bold;
}
* Enhanced dimension compression. E.g.,
.myclass {
border: 4px 4px 4px 4px;
}
becomes:
.myclass {
border: 4px;
}
* Additional color representation compression.
* Strip last semi-colon from blocks. E.g.,
.myclass
{
font-style: bold;
color: red;
}
becomes:
.myclass
{
font-style: bold;
color: red
}
Inherited features
* Removes unneccessary whitespace. E.g.,
.myclass
{
font-style: bold;
}
becomes:
.myclass{font-style:bold;}
* Strip units when value is 0; e.g.,
.myclass
{
margin-left: 0px;
}
becomes:
.myclass
{
margin-left: 0;
}
* Color compression; e.g.,
rgb(51,102,153) -> #336699
#AABBCC -> #ABC
* Remove comments
* Strip empty rules.
Running CSS Compressor
======================
CSS Compressor can be run as a command-line application.
At a command prompt navigate to the path containing CssCompressor.jar
prompt> java -jar CssCompressor.jar [options] [input file]
Usage: java -jar CssCompressor-x.y.z.jar [options] [input file]
Global Options
-h, --help Displays this information
--charset <charset> Read the input file using <charset>
--line-break <column> Insert a line break after the specified column number
-v, --verbose Display informational messages and warnings
-o <file> Place the output into <file>. Defaults to stdout.
If no input file is specified, it defaults to stdin.
License
=======
CSS Compressor is released under the BSD license. See LICENSE.txt for more
details.
Acknowledgements
================
I'd like to thank Julien Lecomte, the original developer of the YUI Compressor
library. His original code acknowledges Isaac Schlueter's cssmin utility.