Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

[css mode] Add simple support for @keyframes

Closes #2161
  • Loading branch information...
commit 38c84639c3606c209b4e1aad3a56ffb85ad65051 1 parent 327b688
@marijnh marijnh authored
Showing with 8 additions and 0 deletions.
  1. +8 −0 mode/css/css.js
View
8 mode/css/css.js
@@ -140,6 +140,8 @@ CodeMirror.defineMode("css", function(config, parserConfig) {
return pushContext(state, stream, "media");
} else if (type == "@font-face") {
return "font_face_before";
+ } else if (/^@(-(moz|ms|o|webkit)-)?keyframes$/.test(type)) {
+ return "keyframes";
} else if (type && type.charAt(0) == "@") {
return pushContext(state, stream, "at");
} else if (type == "hash") {
@@ -264,6 +266,12 @@ CodeMirror.defineMode("css", function(config, parserConfig) {
return "font_face";
};
+ states.keyframes = function(type, stream, state) {
+ if (type == "word") { override = "variable"; return "keyframes"; }
+ if (type == "{") return pushContext(state, stream, "top");
+ return pass(type, stream, state);
+ };
+
states.at = function(type, stream, state) {
if (type == ";") return popContext(state);
if (type == "{" || type == "}") return popAndPass(type, stream, state);
Please sign in to comment.
Something went wrong with that request. Please try again.