-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Non-destructive
@keyframes
rule transformation.
Previously, the transformer did not disambiguate selectors in `@media` blocks and keyframes in `@keyframes` blocks. Now, the transformer can safely transform `@keyframes` blocks. Before a selector is transformed, if the selector has a parent, it is checked. If the checked parent is a `@keyframes` rule, the selector transformation is skipped. Element-specific `@keyframes` are suffixed with the scoped element name. For example, `@keyframes foo` in an element scoped with `x-el-0` will by transformed to `@keyframes foo-x-el-0`. References to that animation in the element's local styles will be updated as well. Added tests for the new keyframes transformation.
- Loading branch information
Chris Joel
committed
Jan 27, 2016
1 parent
3ffc3e2
commit 621397c
Showing
9 changed files
with
644 additions
and
285 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
<!doctype html> | ||
<!-- | ||
@license | ||
Copyright (c) 2014 The Polymer Project Authors. All rights reserved. | ||
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt | ||
The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt | ||
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt | ||
Code distributed by Google as part of the polymer project is also | ||
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt | ||
--> | ||
<script src="../../../webcomponentsjs/webcomponents-lite.js"></script> | ||
<link rel="import" href="../../polymer.html"> | ||
|
||
<body> | ||
<style is="custom-style"> | ||
:root { | ||
--color: blue; | ||
--anim-color: red; | ||
} | ||
|
||
.alternative { | ||
--color: green; | ||
--anim-color: blue; | ||
} | ||
</style> | ||
|
||
<dom-module id="test-keyframes"> | ||
<template><style> | ||
:host { | ||
display: block; | ||
color: var(--color); | ||
animation: foo 3s; | ||
height: 20px; | ||
} | ||
|
||
@keyframes foo { | ||
0% { | ||
background: var(--anim-color); | ||
} | ||
|
||
100% { | ||
background: yellow; | ||
} | ||
} | ||
</style><content></content></template> | ||
<script> | ||
Polymer({ | ||
is: 'test-keyframes' | ||
}); | ||
|
||
</script> | ||
</dom-module> | ||
|
||
<p>Text should be the color blue. Background should animate from the color red to the color yellow, and then become transparent.</p> | ||
<test-keyframes>red</test-keyframes> | ||
|
||
<p>Text should be the color green. Background should animate from the color blue to the color yellow, and then become transparent.</p> | ||
<test-keyframes class="alternative">blue</test-keyframes> | ||
|
||
</body> |
Oops, something went wrong.