douceur
douceur copied to clipboard
Problem with parsing prefixed keyframes
With this CSS
@-webkit-keyframes segment-spin {
from {
-webkit-transform: rotate(0deg);
transform: rotate(0deg)
}
to {
-webkit-transform: rotate(360deg);
transform: rotate(360deg)
}
}
I get:
Unexpected } character: CHAR (line: 11, column: 1): "}"
I think it's because it's not a recognized "AtRule". This works just fine to parse:
@keyframes segment-spin{
from{-webkit-transform:rotate(0deg);transform:rotate(0deg)}
to{-webkit-transform:rotate(360deg);transform:rotate(360deg)}
}
Vendor prefixes makes me cry at night, but a possible solution would be to extend this line.
But pardon me, why maintain a list like that? What other strings that starts with a @
can't all be considered "at rules"? E.g this function could be something like:
func (rule *Rule) EmbedsRules() bool {
return strings.HasPrefix(rule.Name, "@")
}
No?
@aymerick Hi, How likely are you to have time to look into this issue? No pressure. Just curious if I have to fork the code for my own project (with attribution back to you of course).
@peterbe you may want to check out https://github.com/chris-ramon/douceur
@ernsheong You saved my day. Awesome. Thank you.
@ernsheong You saved my day too.