dart-lang / csslib

A library for parsing CSS.
https://pub.dev/packages/csslib
BSD 3-Clause "New" or "Revised" License
95 stars 38 forks source link

Add commas between PercentageTerms in keyframes #151

Closed natebosch closed 2 years ago

natebosch commented 2 years ago

Fixes dart-lang/tools#1172

A previous attempt unconditionally added commas between PercentageTerm values, but those terms can also show up in places where commas are not expected.

Add state on the visitor to track whether we are in the context of a keyframes rule. I think these are the only rules which need comma separated terms, and that it can't be nested in a way where we naively reverting back to false after leaving should cause any problems.