gss.html 2.7 KB

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