From 9098bece5300589526571ba23c94da9e530d5e9f Mon Sep 17 00:00:00 2001 From: Tobias Koppers Date: Sat, 18 Jul 2015 13:22:27 +0200 Subject: [PATCH] don't localize animation-delay etc. fixed webpack/css-loader#107 --- index.js | 2 +- test.js | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/index.js b/index.js index c9ec822..0e077d2 100644 --- a/index.js +++ b/index.js @@ -175,7 +175,7 @@ function localizeDeclValue(valueNode, context) { function localizeDecl(decl, context) { var valuesNode = Tokenizer.parseValues(decl.value); - var localizeName = /animation(-name)?/.test(decl.prop); + var localizeName = /animation(-name)?$/.test(decl.prop); var newValuesNode = Object.create(valuesNode); newValuesNode.nodes = valuesNode.nodes.map(function(valueNode) { var subContext = { diff --git a/test.js b/test.js index ddecc33..f27f623 100644 --- a/test.js +++ b/test.js @@ -139,6 +139,11 @@ var tests = [ input: '.foo { animation-name: bar; }', expected: ':local(.foo) { animation-name: :local(bar); }' }, + { + should: 'not localize a single animation-delay', + input: '.foo { animation-delay: 1s; }', + expected: ':local(.foo) { animation-delay: 1s; }' + }, { should: 'localize multiple animation-names', input: '.foo { animation-name: bar, foobar; }',