Skip to content

Commit

Permalink
Don't emit busted property-less @Keyframes rules.
Browse files Browse the repository at this point in the history
Closes #1391
  • Loading branch information
nex3 committed Aug 22, 2014
1 parent 16a88c9 commit a14866b
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 0 deletions.
2 changes: 2 additions & 0 deletions doc-src/SASS_CHANGELOG.md
Expand Up @@ -10,6 +10,8 @@
* Don't put rulesets inside `@keyframes` directives when bubbling them up to the
top level.

* Properly handle `@keyframes` rules that contain no properties.

## 3.4.0 (18 August 2014)

### Using `&` in SassScript
Expand Down
1 change: 1 addition & 0 deletions lib/sass/tree/visitors/perform.rb
Expand Up @@ -397,6 +397,7 @@ def visit_rule(node)
keyframe_rule_node.line = node.line
keyframe_rule_node.filename = node.filename
keyframe_rule_node.source_range = node.source_range
keyframe_rule_node.has_children = node.has_children
with_environment Sass::Environment.new(@environment, node.options) do
keyframe_rule_node.children = node.children.map {|c| visit(c)}.flatten
end
Expand Down
14 changes: 14 additions & 0 deletions test/sass/scss/css_test.rb
Expand Up @@ -690,6 +690,20 @@ def test_keyframes
SCSS
end

def test_keyframes_with_empty_rules
assert_equal <<CSS, render(<<SCSS)
@keyframes identifier {
50% {
background-color: black; } }
CSS
@keyframes identifier {
0% {}
50% {background-color: black}
100% {}
}
SCSS
end

## Selectors

# Taken from http://dev.w3.org/csswg/selectors4/#overview
Expand Down

0 comments on commit a14866b

Please sign in to comment.