You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

104 lines
2.8 KiB

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