Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem with parsing prefixed keyframes #4

Open
peterbe opened this issue May 16, 2016 · 4 comments
Open

Problem with parsing prefixed keyframes #4

peterbe opened this issue May 16, 2016 · 4 comments

Comments

@peterbe
Copy link

peterbe commented May 16, 2016

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?

@peterbe
Copy link
Author

peterbe commented May 24, 2016

@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).

@ernsheong
Copy link

@peterbe you may want to check out https://github.com/chris-ramon/douceur

@wooseopkim
Copy link

@ernsheong You saved my day. Awesome. Thank you.

czlhs pushed a commit to czlhs/douceur that referenced this issue Mar 21, 2019
@czlhs
Copy link

czlhs commented Mar 21, 2019

@ernsheong You saved my day too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants