Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 2 additions & 5 deletions css/css.go
Original file line number Diff line number Diff line change
Expand Up @@ -246,11 +246,8 @@ func (c *cssMinifier) minifyGrammar() {
c.w.Write(val.Data)
}
c.w.Write(leftBracketBytes)
case css.QualifiedRuleGrammar:
c.minifySelectors(data, c.p.Values())
c.w.Write(commaBytes)
case css.BeginRulesetGrammar:
c.minifySelectors(data, c.p.Values())
c.minifySelectors(c.p.Values())
c.w.Write(leftBracketBytes)
case css.DeclarationGrammar:
c.minifyDeclaration(data, c.p.Values())
Expand All @@ -277,7 +274,7 @@ func (c *cssMinifier) minifyGrammar() {
}
}

func (c *cssMinifier) minifySelectors(property []byte, values []css.Token) {
func (c *cssMinifier) minifySelectors(values []css.Token) {
inAttr := false
isClass := false
for _, val := range c.p.Values() {
Expand Down
1 change: 1 addition & 0 deletions css/css_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ func TestCSS(t *testing.T) {
{"a { b: 1", "a{b:1}"},
{"@unknown { border:1px solid #000 }", "@unknown{border:1px solid #000 }"},
{":root { --custom-variable:0px; }", ":root{--custom-variable:0px}"},
{"a, b, c {color:red}", "a,b,c{color:red}"},

// recurring property overwrites previous
//{"a{color:blue;color:red}", "a{color:red}"},
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ require (
github.com/djherbis/atime v1.1.0
github.com/fsnotify/fsnotify v1.8.0
github.com/tdewolff/argp v0.0.0-20250209172303-079abae893fb
github.com/tdewolff/parse/v2 v2.8.4
github.com/tdewolff/parse/v2 v2.8.5-0.20251020133559-0efcf90bef1a
github.com/tdewolff/test v1.0.11
)

Expand Down
6 changes: 2 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,8 @@ github.com/pelletier/go-toml v1.9.5 h1:4yBQzkHv+7BHq2PQUZF3Mx0IYxG7LsP222s7Agd3v
github.com/pelletier/go-toml v1.9.5/go.mod h1:u1nR/EPcESfeI/szUZKdtJ0xRNbUoANCkoOuaOx1Y+c=
github.com/tdewolff/argp v0.0.0-20250209172303-079abae893fb h1:Id2aj2q74MC+yHBGQNeTVuQp/gqJd3vZjMmdoVPPfVc=
github.com/tdewolff/argp v0.0.0-20250209172303-079abae893fb/go.mod h1:PKhwRVvnrI2gye5NRF3c4VWbE+3E9mGyRUsNWGcJlDY=
github.com/tdewolff/parse/v2 v2.8.3 h1:5VbvtJ83cfb289A1HzRA9sf02iT8YyUwN84ezjkdY1I=
github.com/tdewolff/parse/v2 v2.8.3/go.mod h1:Hwlni2tiVNKyzR1o6nUs4FOF07URA+JLBLd6dlIXYqo=
github.com/tdewolff/parse/v2 v2.8.4 h1:A6slgBLGGDPBMGA28KQZfHpaKffuNvhOe7zSag+x/rw=
github.com/tdewolff/parse/v2 v2.8.4/go.mod h1:Hwlni2tiVNKyzR1o6nUs4FOF07URA+JLBLd6dlIXYqo=
github.com/tdewolff/parse/v2 v2.8.5-0.20251020133559-0efcf90bef1a h1:Rmq+utdraciok/97XHRweYdsAo/M4LOswpCboo3yvN4=
github.com/tdewolff/parse/v2 v2.8.5-0.20251020133559-0efcf90bef1a/go.mod h1:Hwlni2tiVNKyzR1o6nUs4FOF07URA+JLBLd6dlIXYqo=
github.com/tdewolff/test v1.0.6/go.mod h1:6DAvZliBAAnD7rhVgwaM7DE5/d9NMOAJ09SqYqeK4QE=
github.com/tdewolff/test v1.0.11 h1:FdLbwQVHxqG16SlkGveC0JVyrJN62COWTRyUFzfbtBE=
github.com/tdewolff/test v1.0.11/go.mod h1:XPuWBzvdUzhCuxWO1ojpXsyzsA5bFoS3tO/Q3kFuTG8=
Expand Down
Loading