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

keyframes parsing as empty declarations #67

Open
rockrep opened this issue Mar 24, 2016 · 4 comments
Open

keyframes parsing as empty declarations #67

rockrep opened this issue Mar 24, 2016 · 4 comments
Assignees

Comments

@rockrep
Copy link

rockrep commented Mar 24, 2016

css with @Keyframes rules parse as empty rule sets

css_parser (1.4.1)

css = "@keyframes shimmer {\n  0% {\n    background-position: top left;\n  }\n  100% {\n    background-position: top right;\n  }\n}"
parser = CssParser::Parser.new
parser.add_block!(css)
parser.each_rule_set do |rule_set, media_types|
  p rule_set
end

#<CssParser::RuleSet:0x007fca9ce49030 @selectors=["@keyframes shimmer"], @specificity=nil, @declarations={}, @order=0>
=> [{:media_types=>[:all], :rules=>#<CssParser::RuleSet:0x007fca9ce49030 @declarations={}, @order=0, @selectors=["@keyframes shimmer"], @specificity=nil>}]
@grosser
Copy link
Contributor

grosser commented Mar 24, 2016

Please open a PR :)

@rockrep
Copy link
Author

rockrep commented Mar 28, 2016

Would be happy to. But I could use a clue as to where the fix should go

@grosser
Copy link
Contributor

grosser commented Mar 28, 2016

sry, no idea, I'm not really an expert on the internals ...
maybe check a few recent PRs ... chances are it's a similar area ...

@rockrep
Copy link
Author

rockrep commented Mar 29, 2016

@Keyframes uses nested braces of declarations, and the rest of the parser code in https://github.com/premailer/css_parser/blob/master/lib/css_parser/parser.rb#L248 isn't really setup to handle that. A fix has eluded me so far.

@akzhan akzhan self-assigned this Mar 9, 2017
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

3 participants