| 1 |
<!doctype html> |
| 2 |
|
| 3 |
<title>CodeMirror: Closure Stylesheets (GSS) mode</title> |
| 4 |
<meta charset="utf-8"/> |
| 5 |
<link rel=stylesheet href="../../doc/docs.css"> |
| 6 |
|
| 7 |
<link rel="stylesheet" href="../../lib/codemirror.css"> |
| 8 |
<link rel="stylesheet" href="../../addon/hint/show-hint.css"> |
| 9 |
<script src="../../lib/codemirror.js"></script> |
| 10 |
<script src="css.js"></script> |
| 11 |
<script src="../../addon/edit/matchbrackets.js"></script> |
| 12 |
<script src="../../addon/hint/show-hint.js"></script> |
| 13 |
<script src="../../addon/hint/css-hint.js"></script> |
| 14 |
<style>.CodeMirror {background: #f8f8f8;}</style> |
| 15 |
<div id=nav> |
| 16 |
<a href="https://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png" alt=""></a> |
| 17 |
|
| 18 |
<ul> |
| 19 |
<li><a href="../../index.html">Home</a> |
| 20 |
<li><a href="../../doc/manual.html">Manual</a> |
| 21 |
<li><a href="https://github.com/codemirror/codemirror">Code</a> |
| 22 |
</ul> |
| 23 |
<ul> |
| 24 |
<li><a href="../index.html">Language modes</a> |
| 25 |
<li><a class=active href="#">Closure Stylesheets (GSS)</a> |
| 26 |
</ul> |
| 27 |
</div> |
| 28 |
|
| 29 |
<article> |
| 30 |
<h2>Closure Stylesheets (GSS) mode</h2> |
| 31 |
<form><textarea id="code" name="code"> |
| 32 |
/* Some example Closure Stylesheets */ |
| 33 |
|
| 34 |
@provide 'some.styles'; |
| 35 |
|
| 36 |
@require 'other.styles'; |
| 37 |
|
| 38 |
@component { |
| 39 |
|
| 40 |
@def FONT_FAMILY "Times New Roman", Georgia, Serif; |
| 41 |
@def FONT_SIZE_NORMAL 15px; |
| 42 |
@def FONT_NORMAL normal FONT_SIZE_NORMAL FONT_FAMILY; |
| 43 |
|
| 44 |
@def BG_COLOR rgb(235, 239, 249); |
| 45 |
|
| 46 |
@def DIALOG_BORDER_COLOR rgb(107, 144, 218); |
| 47 |
@def DIALOG_BG_COLOR BG_COLOR; |
| 48 |
|
| 49 |
@def LEFT_HAND_NAV_WIDTH 180px; |
| 50 |
@def LEFT_HAND_NAV_PADDING 3px; |
| 51 |
|
| 52 |
@defmixin size(WIDTH, HEIGHT) { |
| 53 |
width: WIDTH; |
| 54 |
height: HEIGHT; |
| 55 |
} |
| 56 |
|
| 57 |
body { |
| 58 |
background-color: BG_COLOR; |
| 59 |
margin: 0; |
| 60 |
padding: 3em 6em; |
| 61 |
font: FONT_NORMAL; |
| 62 |
color: #000; |
| 63 |
} |
| 64 |
|
| 65 |
#navigation a { |
| 66 |
font-weight: bold; |
| 67 |
text-decoration: none !important; |
| 68 |
} |
| 69 |
|
| 70 |
.dialog { |
| 71 |
background-color: DIALOG_BG_COLOR; |
| 72 |
border: 1px solid DIALOG_BORDER_COLOR; |
| 73 |
} |
| 74 |
|
| 75 |
.content { |
| 76 |
position: absolute; |
| 77 |
margin-left: add(LEFT_HAND_NAV_PADDING, /* padding left */ |
| 78 |
LEFT_HAND_NAV_WIDTH, |
| 79 |
LEFT_HAND_NAV_PADDING); /* padding right */ |
| 80 |
|
| 81 |
} |
| 82 |
|
| 83 |
.logo { |
| 84 |
@mixin size(150px, 55px); |
| 85 |
background-image: url('http://www.google.com/images/logo_sm.gif'); |
| 86 |
} |
| 87 |
|
| 88 |
} |
| 89 |
</textarea></form> |
| 90 |
<script> |
| 91 |
var editor = CodeMirror.fromTextArea(document.getElementById("code"), { |
| 92 |
extraKeys: {"Ctrl-Space": "autocomplete"}, |
| 93 |
lineNumbers: true, |
| 94 |
matchBrackets: true, |
| 95 |
mode: "text/x-gss" |
| 96 |
}); |
| 97 |
</script> |
| 98 |
|
| 99 |
<p>A mode for <a href="https://github.com/google/closure-stylesheets">Closure Stylesheets</a> (GSS).</p> |
| 100 |
<p><strong>MIME type defined:</strong> <code>text/x-gss</code>.</p> |
| 101 |
|
| 102 |
<p><strong>Parsing/Highlighting Tests:</strong> <a href="../../test/index.html#gss_*">normal</a>, <a href="../../test/index.html#verbose,gss_*">verbose</a>.</p> |
| 103 |
|
| 104 |
</article> |
| 105 |
|