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.

158 lines
2.7 KiB

2 months ago
  1. <!doctype html>
  2. <title>CodeMirror: SCSS mode</title>
  3. <meta charset="utf-8"/>
  4. <link rel=stylesheet href="../../doc/docs.css">
  5. <link rel="stylesheet" href="../../lib/codemirror.css">
  6. <script src="../../lib/codemirror.js"></script>
  7. <script src="../../addon/edit/matchbrackets.js"></script>
  8. <script src="css.js"></script>
  9. <style>.CodeMirror {background: #f8f8f8;}</style>
  10. <div id=nav>
  11. <a href="https://codemirror.net/5"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png" alt=""></a>
  12. <ul>
  13. <li><a href="../../index.html">Home</a>
  14. <li><a href="../../doc/manual.html">Manual</a>
  15. <li><a href="https://github.com/codemirror/codemirror5">Code</a>
  16. </ul>
  17. <ul>
  18. <li><a href="../index.html">Language modes</a>
  19. <li><a class=active href="#">SCSS</a>
  20. </ul>
  21. </div>
  22. <article>
  23. <h2>SCSS mode</h2>
  24. <form><textarea id="code" name="code">
  25. /* Some example SCSS */
  26. @import "compass/css3";
  27. $variable: #333;
  28. $blue: #3bbfce;
  29. $margin: 16px;
  30. .content-navigation {
  31. #nested {
  32. background-color: black;
  33. }
  34. border-color: $blue;
  35. color:
  36. darken($blue, 9%);
  37. }
  38. .border {
  39. padding: $margin / 2;
  40. margin: $margin / 2;
  41. border-color: $blue;
  42. }
  43. @mixin table-base {
  44. th {
  45. text-align: center;
  46. font-weight: bold;
  47. }
  48. td, th {padding: 2px}
  49. }
  50. table.hl {
  51. margin: 2em 0;
  52. td.ln {
  53. text-align: right;
  54. }
  55. }
  56. li {
  57. font: {
  58. family: serif;
  59. weight: bold;
  60. size: 1.2em;
  61. }
  62. }
  63. @mixin left($dist) {
  64. float: left;
  65. margin-left: $dist;
  66. }
  67. #data {
  68. @include left(10px);
  69. @include table-base;
  70. }
  71. .source {
  72. @include flow-into(target);
  73. border: 10px solid green;
  74. margin: 20px;
  75. width: 200px; }
  76. .new-container {
  77. @include flow-from(target);
  78. border: 10px solid red;
  79. margin: 20px;
  80. width: 200px; }
  81. body {
  82. margin: 0;
  83. padding: 3em 6em;
  84. font-family: tahoma, arial, sans-serif;
  85. color: #000;
  86. }
  87. @mixin yellow() {
  88. background: yellow;
  89. }
  90. .big {
  91. font-size: 14px;
  92. }
  93. .nested {
  94. @include border-radius(3px);
  95. @extend .big;
  96. p {
  97. background: whitesmoke;
  98. a {
  99. color: red;
  100. }
  101. }
  102. }
  103. #navigation a {
  104. font-weight: bold;
  105. text-decoration: none !important;
  106. }
  107. h1 {
  108. font-size: 2.5em;
  109. }
  110. h2 {
  111. font-size: 1.7em;
  112. }
  113. h1:before, h2:before {
  114. content: "::";
  115. }
  116. code {
  117. font-family: courier, monospace;
  118. font-size: 80%;
  119. color: #418A8A;
  120. }
  121. </textarea></form>
  122. <script>
  123. var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
  124. lineNumbers: true,
  125. matchBrackets: true,
  126. mode: "text/x-scss"
  127. });
  128. </script>
  129. <p>The SCSS mode is a sub-mode of the <a href="index.html">CSS mode</a> (defined in <code>css.js</code>).</p>
  130. <p><strong>Parsing/Highlighting Tests:</strong> <a href="../../test/index.html#scss_*">normal</a>, <a href="../../test/index.html#verbose,scss_*">verbose</a>.</p>
  131. </article>