Skip to content

Commit

Permalink
feat: create separate stylesheet for keyframes
Browse files Browse the repository at this point in the history
  • Loading branch information
streamich committed Mar 17, 2018
1 parent fd74dbf commit 90a75a1
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion addon/keyframes.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ exports.addon = function (renderer) {
require('./__dev__/warnOnMissingDependencies')('keyframes', renderer, ['putRaw', 'put']);
}

if (renderer.client) {
// Craete @keyframe Stylesheet `ksh`.
document.head.appendChild(renderer.ksh = document.createElement('style'))
}

var putAtrule = renderer.putAtrule;

renderer.putAtrule = function (__, keyframes, prelude) {
Expand All @@ -25,7 +30,7 @@ exports.addon = function (renderer) {
str = prelude + '{' + str + '}';

if (renderer.client) {
renderer.sh.appendChild(document.createTextNode(str));
renderer.ksh.appendChild(document.createTextNode(str));
} else {
renderer.raw += str;
}
Expand Down

0 comments on commit 90a75a1

Please sign in to comment.