Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,14 @@ module.exports = function postcssPrefixSelector(options) {

return function(root) {
root.walkRules(rule => {
if (rule.parent && rule.parent.name === 'keyframes') {
const keyframeRules = [
'keyframes',
'-webkit-keyframes',
'-moz-keyframes',
'-o-keyframes'
];

if (rule.parent && keyframeRules.includes(rule.parent.name)) {
return;
}

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "postcss-prefix-selector",
"description": "Prefix all CSS rules with a selector",
"version": "1.7.1",
"version": "1.7.2",
"author": "Jonathan Ong <me@jongleberry.com> (http://jongleberry.com)",
"contributors": [
"Valentin Radulescu <valentin@radulescu.me> (https://valentin.io)"
Expand Down
27 changes: 27 additions & 0 deletions test/fixtures/keyframes.css
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,30 @@
color: red;
}
}

@-webkit-keyframes glow {
from {
color: coral;
}
to {
color: red;
}
}

@-moz-keyframes glow {
from {
color: coral;
}
to {
color: red;
}
}

@-o-keyframes glow {
from {
color: coral;
}
to {
color: red;
}
}
27 changes: 27 additions & 0 deletions test/fixtures/keyframes.expected.css
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,30 @@
color: red;
}
}

@-webkit-keyframes glow {
from {
color: coral;
}
to {
color: red;
}
}

@-moz-keyframes glow {
from {
color: coral;
}
to {
color: red;
}
}

@-o-keyframes glow {
from {
color: coral;
}
to {
color: red;
}
}