Skip to content

Commit 0c51ab0

Browse files
committed
Added command line application
Reorganized aliases file with some additions Initial-values updated Added more internal utility methods Slight internal changes for the command line application Some internal method renaming for readability Updated csscrush::string to handle import statements feature: Added command line application feature: 'rewrite_import_urls' option - Ability to rewrite relative url references inside imported css files feature: Variable values can be excluded from function parsing by preceeding with '!!' feature: CSS comments can be made private by adding a marker '$!' at the first character Math function now surpresses parse errors, returns 0 on error issue peteboere#21: workaround for php installations that do not support bcmath extension feature: Prepend.css - A css file in csscrush root folder prepended to every input, by default populated only with variables
1 parent ed61165 commit 0c51ab0

File tree

14 files changed

+1015
-472
lines changed

14 files changed

+1015
-472
lines changed

Aliases.ini

Lines changed: 97 additions & 81 deletions
Original file line numberDiff line numberDiff line change
@@ -7,50 +7,6 @@
77

88
[properties]
99

10-
; Border radius
11-
border-radius[] = -webkit-border-radius
12-
border-radius[] = -moz-border-radius
13-
border-top-left-radius[] = -webkit-border-top-left-radius
14-
border-top-left-radius[] = -moz-border-radius-topleft
15-
border-top-right-radius[] = -webkit-border-top-right-radius
16-
border-top-right-radius[] = -moz-border-radius-topright
17-
border-bottom-left-radius[] = -webkit-border-bottom-left-radius
18-
border-bottom-left-radius[] = -moz-border-radius-bottomleft
19-
border-bottom-right-radius[] = -webkit-border-bottom-right-radius
20-
border-bottom-right-radius[] = -moz-border-radius-bottomright
21-
22-
; Box shadow
23-
box-shadow[] = -webkit-box-shadow
24-
box-shadow[] = -moz-box-shadow
25-
26-
; Transforms
27-
transform[] = -webkit-transform
28-
transform[] = -moz-transform
29-
transform[] = -ms-transform
30-
transform[] = -o-transform
31-
32-
; Transitions
33-
transition[] = -webkit-transition
34-
transition[] = -moz-transition
35-
transition[] = -ms-transition
36-
transition[] = -o-transition
37-
transition-delay[] = -webkit-transition-delay
38-
transition-delay[] = -moz-transition-delay
39-
transition-delay[] = -ms-transition-delay
40-
transition-delay[] = -o-transition-delay
41-
transition-duration[] = -webkit-transition-duration
42-
transition-duration[] = -moz-transition-duration
43-
transition-duration[] = -ms-transition-duration
44-
transition-duration[] = -o-transition-duration
45-
transition-property[] = -webkit-transition-property
46-
transition-property[] = -moz-transition-property
47-
transition-property[] = -ms-transition-property
48-
transition-property[] = -o-transition-property
49-
transition-timing-function[] = -webkit-transition-timing-function
50-
transition-timing-function[] = -moz-transition-timing-function
51-
transition-timing-function[] = -ms-transition-timing-function
52-
transition-timing-function[] = -o-transition-timing-function
53-
5410
; Animations
5511
animation[] = -webkit-animation
5612
animation[] = -moz-animation
@@ -80,10 +36,10 @@
8036
animation-timing-function[] = -moz-animation-timing-function
8137
animation-timing-function[] = -ms-animation-timing-function
8238

83-
84-
; Background size
85-
background-size[] = -webkit-background-size
86-
background-size[] = -moz-background-size
39+
; Backface visibility
40+
backface-visibility[] = -webkit-backface-visibility
41+
backface-visibility[] = -moz-backface-visibility
42+
backface-visibility[] = -ms-backface-visibility
8743

8844
; Background clip
8945
background-clip[] = -webkit-background-clip
@@ -93,6 +49,48 @@
9349
background-origin[] = -webkit-background-origin
9450
background-origin[] = -moz-background-origin
9551

52+
; Background size
53+
background-size[] = -webkit-background-size
54+
background-size[] = -moz-background-size
55+
56+
; Border radius
57+
border-radius[] = -webkit-border-radius
58+
border-radius[] = -moz-border-radius
59+
border-top-left-radius[] = -webkit-border-top-left-radius
60+
border-top-left-radius[] = -moz-border-radius-topleft
61+
border-top-right-radius[] = -webkit-border-top-right-radius
62+
border-top-right-radius[] = -moz-border-radius-topright
63+
border-bottom-left-radius[] = -webkit-border-bottom-left-radius
64+
border-bottom-left-radius[] = -moz-border-radius-bottomleft
65+
border-bottom-right-radius[] = -webkit-border-bottom-right-radius
66+
border-bottom-right-radius[] = -moz-border-radius-bottomright
67+
68+
; Border-image
69+
border-image[] = -webkit-border-image
70+
border-image[] = -moz-border-image
71+
border-image[] = -o-border-image
72+
73+
; Flexbox (old, but supported implementation)
74+
box-align[] = -webkit-box-align
75+
box-align[] = -moz-box-align
76+
box-align[] = -ms-box-align
77+
box-direction[] = -webkit-box-direction
78+
box-direction[] = -moz-box-direction
79+
box-direction[] = -ms-box-direction
80+
box-flex[] = -webkit-box-flex
81+
box-flex[] = -moz-box-flex
82+
box-flex[] = -ms-box-flex
83+
box-orient[] = -webkit-box-orient
84+
box-orient[] = -moz-box-orient
85+
box-orient[] = -ms-box-orient
86+
box-pack[] = -webkit-box-pack
87+
box-pack[] = -moz-box-pack
88+
box-pack[] = -ms-box-pack
89+
90+
; Box shadow
91+
box-shadow[] = -webkit-box-shadow
92+
box-shadow[] = -moz-box-shadow
93+
9694
; Box sizing
9795
box-sizing[] = -webkit-box-sizing
9896
box-sizing[] = -moz-box-sizing
@@ -120,57 +118,75 @@
120118
column-span[] = -moz-column-span
121119
column-width[] = -webkit-column-width
122120
column-width[] = -moz-column-width
123-
124-
125-
; Border-image
126-
border-image[] = -webkit-border-image
127-
border-image[] = -moz-border-image
128-
border-image[] = -o-border-image
129-
130-
; Flexbox (old, but supported implementation)
131-
box-align[] = -webkit-box-align
132-
box-align[] = -moz-box-align
133-
box-align[] = -ms-box-align
134-
box-direction[] = -webkit-box-direction
135-
box-direction[] = -moz-box-direction
136-
box-direction[] = -ms-box-direction
137-
box-flex[] = -webkit-box-flex
138-
box-flex[] = -moz-box-flex
139-
box-flex[] = -ms-box-flex
140-
box-orient[] = -webkit-box-orient
141-
box-orient[] = -moz-box-orient
142-
box-orient[] = -ms-box-orient
143-
box-pack[] = -webkit-box-pack
144-
box-pack[] = -moz-box-pack
145-
box-pack[] = -ms-box-pack
146121

147122
; Hyphens
148123
hyphens[] = -webkit-hyphens
149124
hyphens[] = -moz-hyphens
150125
hyphens[] = -ms-hyphens
151126

127+
; Perspective
128+
perspective[] = -webkit-perspective
129+
perspective[] = -moz-perspective
130+
perspective[] = -ms-perspective
131+
perspective-origin[] = -webkit-perspective-origin
132+
perspective-origin[] = -moz-perspective-origin
133+
perspective-origin[] = -ms-perspective-origin
134+
135+
; Tab size
136+
tab-size[] = -webkit-tab-size
137+
tab-size[] = -moz-tab-size
138+
tab-size[] = -o-tab-size
139+
152140
; Text decoration
153141
text-decoration-color[] = -moz-text-decoration-color
154142
text-decoration-line[] = -moz-text-decoration-line
155143
text-decoration-style[] = -moz-text-decoration-style
156144

145+
; Transforms
146+
transform[] = -webkit-transform
147+
transform[] = -moz-transform
148+
transform[] = -ms-transform
149+
transform[] = -o-transform
150+
transform-style[] = -webkit-transform-style
151+
transform-style[] = -moz-transform-style
152+
transform-style[] = -ms-transform-style
153+
154+
; Transitions
155+
transition[] = -webkit-transition
156+
transition[] = -moz-transition
157+
transition[] = -ms-transition
158+
transition[] = -o-transition
159+
transition-delay[] = -webkit-transition-delay
160+
transition-delay[] = -moz-transition-delay
161+
transition-delay[] = -ms-transition-delay
162+
transition-delay[] = -o-transition-delay
163+
transition-duration[] = -webkit-transition-duration
164+
transition-duration[] = -moz-transition-duration
165+
transition-duration[] = -ms-transition-duration
166+
transition-duration[] = -o-transition-duration
167+
transition-property[] = -webkit-transition-property
168+
transition-property[] = -moz-transition-property
169+
transition-property[] = -ms-transition-property
170+
transition-property[] = -o-transition-property
171+
transition-timing-function[] = -webkit-transition-timing-function
172+
transition-timing-function[] = -moz-transition-timing-function
173+
transition-timing-function[] = -ms-transition-timing-function
174+
transition-timing-function[] = -o-transition-timing-function
175+
157176
; User select (non standard)
158177
user-select[] = -webkit-user-select
159178
user-select[] = -moz-user-select
160179
user-select[] = -ms-user-select
161180
user-select[] = -o-user-select
162181
user-select[] = user-select
163182

164-
; Tab size
165-
tab-size[] = -webkit-tab-size
166-
tab-size[] = -moz-tab-size
167-
tab-size[] = -o-tab-size
168-
169183

170184
;----------------------------------------------------------------------------
171-
;-- Value aliases
185+
;-- Property:value aliases
172186

173187
[values]
188+
189+
; Flexbox
174190
display:box[] = -webkit-box
175191
display:box[] = -moz-box
176192
display:box[] = -ms-box
@@ -181,6 +197,10 @@
181197

182198
[functions]
183199

200+
; Calc
201+
calc[] = -webkit-calc
202+
calc[] = -moz-calc
203+
184204
; Gradients
185205
linear-gradient[] = -webkit-linear-gradient
186206
linear-gradient[] = -moz-linear-gradient
@@ -201,10 +221,6 @@
201221
repeating-radial-gradient[] = -ms-repeating-radial-gradient
202222
repeating-radial-gradient[] = -o-repeating-radial-gradient
203223

204-
; Calc
205-
calc[] = -webkit-calc
206-
calc[] = -moz-calc
207-
208224

209225
;----------------------------------------------------------------------------
210226
;-- @rule aliases

CHANGELOG

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,16 @@
1-
1.4
1+
1.4.1
22
-----
3+
Added command line application
4+
Added 'rewrite_import_urls' option - Ability to rewrite relative url references inside imported css files
5+
Added Prepend.css - Optionally prepend css to every input
6+
Fix for issue #21
7+
Reorganized aliases file with some additions
8+
Initial-values updated
9+
Updated csscrush::string method to correctly handle import statements
10+
11+
12+
1.4
13+
---
314
Added initial-keyword plugin (shim for the CSS3 keyword)
415
Added inline method (Issue #18)
516
Added ability to escape declarations from aliasing or plugins by prefixing with tilde

CssCrush.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@
44
* CSS Crush
55
* Extensible CSS preprocessor
66
*
7-
* @version 1.4
7+
* @version 1.4.1
88
* @license http://www.opensource.org/licenses/mit-license.php (MIT)
9-
* @copyright Copyright 2010-2011 Pete Boere
9+
* @copyright Copyright 2010-2012 Pete Boere
10+
*
1011
*
11-
* @example
1212
* <?php
1313
*
1414
* // Basic usage

Plugins.ini

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
plugins[] = ie-inline-block.php
1010

1111
; clip property shim for IE < 8
12-
plugins[] = ie-clip.php
12+
; plugins[] = ie-clip.php
1313

1414
; IE filter shorthand
1515
; plugins[] = ie-filter.php
@@ -18,10 +18,10 @@ plugins[] = ie-clip.php
1818
; plugins[] = ie-opacity.php
1919

2020
; Opaque fallback colors for clients that don't support RGBA
21-
plugins[] = rgba-fallback.php
21+
; plugins[] = rgba-fallback.php
2222

2323
; HSL shim - converts HSL values to hex codes
24-
plugins[] = hsl-to-hex.php
24+
; plugins[] = hsl-to-hex.php
2525

2626
; Compiles pseudo element double colon syntax to single colon for backwards compatibility
2727
plugins[] = double-colon.php

Prepend.css

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
/*$!
2+
3+
Prepend.css contains library variables by default, but it could also contain reset styles such as reset.css or normalize.css that you would need prepended to every css file.
4+
5+
*/
6+
7+
@define {
8+
9+
/*------------------------
10+
Font stacks
11+
------------------------*/
12+
13+
/* Serif */
14+
georgia: Georgia, Times, "Times New Roman", serif;
15+
times: Times, "Times New Roman", serif;
16+
palatino: Palatino, 'Palatino Linotype', "Hoefler Text", serif;
17+
serif: $( times );
18+
19+
/* Sans-serif */
20+
helvetica: "Helvetica Neue", Helvetica, Arial, sans-serif;
21+
arial: "Arial Unicode MS", Arial, Helvetica, sans-serif;
22+
verdana: Verdana, Tahoma, Arial, sans-serif;
23+
lucida: "Lucida Sans Unicode", "Lucida Sans", "Lucida Grande", Verdana, sans-serif;
24+
sans-serif: $( arial );
25+
26+
/* Monospace */
27+
courier: "Courier New", Courier, mono;
28+
consolas: Consolas, "Lucida Console", Monaco, "Courier New", Courier, mono;
29+
monaco: Monaco, "Courier New", Courier, mono;
30+
mono: $( courier );
31+
32+
/* Unicode */
33+
unicode: "Arial Unicode MS", Arial, "Microsoft Sans Serif", "Lucida Grande", sans-serif;
34+
35+
}
36+
37+
38+
39+

0 commit comments

Comments
 (0)