sqwish 0.0.3 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/lib/sqwish.rb +1 -1
- data/sqwish/src/index.js +6 -0
- metadata +3 -3
data/lib/sqwish.rb
CHANGED
data/sqwish/src/index.js
CHANGED
|
@@ -49,6 +49,12 @@ function sqwish(css, strict) {
|
|
|
49
49
|
// convert longhand hex to shorthand hex
|
|
50
50
|
.replace(/#([a-fA-F0-9])\1([a-fA-F0-9])\2([a-fA-F0-9])\3/g, '#$1$2$3')
|
|
51
51
|
|
|
52
|
+
// replace longhand values with shorthand '5px 5px 5px 5px' => '5px'
|
|
53
|
+
.replace(/(\d+[a-z]{2}) \1 \1 \1/gi, '$1')
|
|
54
|
+
|
|
55
|
+
// replace double-specified longhand values with shorthand '5px 2px 5px 2px' => '5px 2px'
|
|
56
|
+
.replace(/(\d+[a-z]{2}) (\d+[a-z]{2}) \1 \2/gi, '$1 $2')
|
|
57
|
+
|
|
52
58
|
// replace 0px with 0
|
|
53
59
|
.replace(/([\s|:])[0]+px/g, '$10');
|
|
54
60
|
|
metadata
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
name: sqwish
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
4
|
prerelease:
|
|
5
|
-
version: 0.
|
|
5
|
+
version: 0.1.2
|
|
6
6
|
platform: ruby
|
|
7
7
|
authors:
|
|
8
8
|
- Rico Sta. Cruz
|
|
@@ -11,7 +11,7 @@ autorequire:
|
|
|
11
11
|
bindir: bin
|
|
12
12
|
cert_chain: []
|
|
13
13
|
|
|
14
|
-
date: 2011-
|
|
14
|
+
date: 2011-05-05 00:00:00 +08:00
|
|
15
15
|
default_executable:
|
|
16
16
|
dependencies:
|
|
17
17
|
- !ruby/object:Gem::Dependency
|
|
@@ -63,7 +63,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
63
63
|
requirements: []
|
|
64
64
|
|
|
65
65
|
rubyforge_project:
|
|
66
|
-
rubygems_version: 1.
|
|
66
|
+
rubygems_version: 1.6.2
|
|
67
67
|
signing_key:
|
|
68
68
|
specification_version: 3
|
|
69
69
|
summary: A node-based CSS compressor
|