Skip to content

Commit 61f0c68

Browse files
committed
[sass mode] Integrate new mode
1 parent 6a28fd6 commit 61f0c68

File tree

5 files changed

+60
-0
lines changed

5 files changed

+60
-0
lines changed

doc/compress.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,8 @@ <h1><span class="logo-braces">{ }</span> <a href="http://codemirror.net/">CodeMi
103103
<option value="http://codemirror.net/mode/rst/rst.js">rst.js</option>
104104
<option value="http://codemirror.net/mode/ruby/ruby.js">ruby.js</option>
105105
<option value="http://codemirror.net/mode/rust/rust.js">rust.js</option>
106+
<option value="http://codemirror.net/mode/sass/sass.js">sass.js</option>
107+
<option value="http://codemirror.net/mode/scala/scala.js">scala.js</option>
106108
<option value="http://codemirror.net/mode/scheme/scheme.js">scheme.js</option>
107109
<option value="http://codemirror.net/mode/shell/shell.js">shell.js</option>
108110
<option value="http://codemirror.net/mode/sieve/sieve.js">sieve.js</option>

doc/realworld.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ <h1><span class="logo-braces">{ }</span> <a href="http://codemirror.net/">CodeMi
2828
<li><a href="http://www.codebugapp.com/">Codebug</a> (PHP Xdebug front-end)</li>
2929
<li><a href="http://code.google.com/p/codemirror2-gwt/">CodeMirror2-GWT</a> (Google Web Toolkit wrapper)</li>
3030
<li><a href="http://codepen.io">Codepen</a> (gallery of animations)</li>
31+
<li><a href="http://sasstwo.codeschool.com/levels/1/challenges/1">Code School</a> (online tech learning environment)</li>
3132
<li><a href="http://codev.it/">Codev</a> (collaborative IDE)</li>
3233
<li><a href="http://ot.substance.io/demo/">Collaborative CodeMirror demo</a> (CodeMirror + operational transforms)</li>
3334
<li><a href="http://www.ckwnc.com/">CKWNC</a> (UML editor)</li>

index.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ <h2 style="margin-top: 0">Supported modes:</h2>
7070
<li><a href="mode/rst/index.html">reStructuredText</a></li>
7171
<li><a href="mode/ruby/index.html">Ruby</a></li>
7272
<li><a href="mode/rust/index.html">Rust</a></li>
73+
<li><a href="mode/sass/index.html">Sass</a></li>
7374
<li><a href="mode/clike/scala.html">Scala</a></li>
7475
<li><a href="mode/scheme/index.html">Scheme</a></li>
7576
<li><a href="mode/shell/index.html">Shell</a></li>

mode/sass/index.html

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
<!doctype html>
2+
<html>
3+
<head>
4+
<meta charset="utf-8">
5+
<title>CodeMirror: Sass mode</title>
6+
<link rel="stylesheet" href="../../lib/codemirror.css">
7+
<script src="../../lib/codemirror.js"></script>
8+
<script src="../../lib/util/matchbrackets.js"></script>
9+
<script src="sass.js"></script>
10+
<style>.CodeMirror {border: 1px solid #ddd; font-size:12px; height: 400px}</style>
11+
<link rel="stylesheet" href="../../doc/docs.css">
12+
</head>
13+
<body>
14+
<h1>CodeMirror: Sass mode</h1>
15+
<form><textarea id="code" name="code">// Variable Definitions
16+
17+
$page-width: 800px
18+
$sidebar-width: 200px
19+
$primary-color: #eeeeee
20+
21+
// Global Attributes
22+
23+
body
24+
font:
25+
family: sans-serif
26+
size: 30em
27+
weight: bold
28+
29+
// Scoped Styles
30+
31+
#contents
32+
width: $page-width
33+
#sidebar
34+
float: right
35+
width: $sidebar-width
36+
#main
37+
width: $page-width - $sidebar-width
38+
background: $primary-color
39+
h2
40+
color: blue
41+
42+
#footer
43+
height: 200px
44+
</textarea></form>
45+
<script>
46+
var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
47+
lineNumbers : true,
48+
matchBrackets : true
49+
});
50+
</script>
51+
52+
<p><strong>MIME types defined:</strong> <code>text/x-sass</code>.</p>
53+
</body>
54+
</html>

mode/sass/sass.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -358,3 +358,5 @@ CodeMirror.defineMode("sass", function(config) {
358358
}
359359
};
360360
});
361+
362+
CodeMirror.defineMIME("text/x-sass", "sass");

0 commit comments

Comments
 (0)