css parser chokes on @ type selectors
romanbsd opened this issue · comments
Roman Shterenzon commented
For instance, the Twitter's bootstrap.css has the following selector:
@-webkit-keyframes progress-bar-stripes {
from {
background-position: 40px 0;
}
to {
background-position: 0 0;
}
}
the workaround I have right now is the following:
--- a/lib/roadie/inliner.rb
+++ b/lib/roadie/inliner.rb
@@ -143,7 +143,7 @@ module Roadie
end
def each_selector_without_psuedo(rules)
- rules.selectors.reject { |selector| selector.include?(':') }.each do |selector|
+ rules.selectors.reject { |selector| selector.include?(':') or selector.starts_with?('@') }.each do |selector|
yield selector, CssParser.calculate_specificity(selector)
end
end
Magnus Bergmark commented
Would you mind opening a pull request with this fix along with some tests?
If you follow proper commit guidelines (general Git) and I'm happy about the tests, I'll accept it right away.
Roman Shterenzon commented
I wasn't sure that it's a proper fix for this issue.
Magnus Bergmark commented
I just released version 2.3.2 with this fix. Thank you for your contribution!