Skip to content

Commit 83580a2

Browse files
committed
css/css.go: fix background-color:transparent handling
addresses: ``` $ go test ./... ok github.com/tdewolff/minify/v2 (cached) ? github.com/tdewolff/minify/v2/bindings/js [no test files] ? github.com/tdewolff/minify/v2/bindings/py [no test files] ok github.com/tdewolff/minify/v2/cmd/minify (cached) --- FAIL: TestCSSInline (0.00s) --- FAIL: TestCSSInline/background-color:transparent (0.00s) css_test.go:438:438: background-color:transparent background-color:transparent background-color:initial FAIL FAIL github.com/tdewolff/minify/v2/css 0.005s ok github.com/tdewolff/minify/v2/html (cached) ok github.com/tdewolff/minify/v2/js (cached) ok github.com/tdewolff/minify/v2/json (cached) ok github.com/tdewolff/minify/v2/minify (cached) ok github.com/tdewolff/minify/v2/svg (cached) ok github.com/tdewolff/minify/v2/xml (cached) FAIL ``` Signed-off-by: Leo <i@hardrain980.com>
1 parent 8985643 commit 83580a2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

‎css/css.go‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1140,7 +1140,7 @@ func (c *cssMinifier) minifyProperty(prop Hash, values []Token) []Token {
11401140
values[0] = minifyColor(values[0])
11411141
case Background_Color:
11421142
values[0] = minifyColor(values[0])
1143-
if c.o.Version == 0 {
1143+
if c.o.Version >= 3 {
11441144
if values[0].Ident == Transparent {
11451145
values[0].Data = initialBytes
11461146
values[0].Ident = Initial

0 commit comments

Comments
 (0)