-
Notifications
You must be signed in to change notification settings - Fork 135
/
sass.sync.html
41 lines (39 loc) · 1.38 KB
/
sass.sync.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>Sass.js Sync Console</title>
</head>
<body>
<h1>Sass.js Sync Console</h1>
<p>This document loads the <em>synchronous</em> Sass.js. Please open your browser's DevTools to use the API.</p>
<h2>Try the following example:</h2>
<pre>Sass.writeFile('testfile.scss', '@import "sub/deeptest";\n.testfile { content: "loaded"; }', function() {
console.log('wrote "testfile.scss"');
});
Sass.writeFile('sub/deeptest.scss', '.deeptest { content: "loaded"; }', function() {
console.log('wrote "sub/deeptest.scss"');
});
Sass.options({ style: Sass.style.expanded }, function(result) {
console.log("set options");
});
Sass.compile('@import "testfile";', function(result) {
console.log("compiled", result.text);
});</pre>
<script src="dist/sass.sync.js"></script>
<script>
Sass.writeFile('testfile.scss', '@import "sub/deeptest";\n.testfile { content: "loaded"; }', function() {
console.log('wrote "testfile.scss"');
});
Sass.writeFile('sub/deeptest.scss', '.deeptest { content: "loaded"; }', function() {
console.log('wrote "sub/deeptest.scss"');
});
Sass.options({ style: Sass.style.expanded }, function(result) {
console.log("set options");
});
Sass.compile('@import "testfile";', function(result) {
console.log("compiled", result.text);
});
</script>
</body>
</html>