codemirror.css 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263
  1. /* BASICS */
  2. .CodeMirror {
  3. /* Set height, width, borders, and global font properties here */
  4. font-family: monospace;
  5. height: 300px;
  6. }
  7. .CodeMirror-scroll {
  8. /* Set scrolling behaviour here */
  9. overflow: auto;
  10. }
  11. /* PADDING */
  12. .CodeMirror-lines {
  13. padding: 4px 0; /* Vertical padding around content */
  14. }
  15. .CodeMirror pre {
  16. padding: 0 4px; /* Horizontal padding of content */
  17. }
  18. .CodeMirror-scrollbar-filler, .CodeMirror-gutter-filler {
  19. background-color: white; /* The little square between H and V scrollbars */
  20. }
  21. /* GUTTER */
  22. .CodeMirror-gutters {
  23. border-right: 1px solid #ddd;
  24. background-color: #f7f7f7;
  25. white-space: nowrap;
  26. }
  27. .CodeMirror-linenumbers {}
  28. .CodeMirror-linenumber {
  29. padding: 0 3px 0 5px;
  30. min-width: 20px;
  31. text-align: right;
  32. color: #999;
  33. }
  34. /* CURSOR */
  35. .CodeMirror div.CodeMirror-cursor {
  36. border-left: 1px solid black;
  37. z-index: 3;
  38. }
  39. /* Shown when moving in bi-directional text */
  40. .CodeMirror div.CodeMirror-secondarycursor {
  41. border-left: 1px solid silver;
  42. }
  43. .CodeMirror.cm-keymap-fat-cursor div.CodeMirror-cursor {
  44. width: auto;
  45. border: 0;
  46. background: #7e7;
  47. z-index: 1;
  48. }
  49. /* Can style cursor different in overwrite (non-insert) mode */
  50. .CodeMirror div.CodeMirror-cursor.CodeMirror-overwrite {}
  51. .cm-tab { display: inline-block; }
  52. /* DEFAULT THEME */
  53. .cm-s-default .cm-keyword {color: #708;}
  54. .cm-s-default .cm-atom {color: #219;}
  55. .cm-s-default .cm-number {color: #164;}
  56. .cm-s-default .cm-def {color: #00f;}
  57. .cm-s-default .cm-variable {color: black;}
  58. .cm-s-default .cm-variable-2 {color: #05a;}
  59. .cm-s-default .cm-variable-3 {color: #085;}
  60. .cm-s-default .cm-property {color: black;}
  61. .cm-s-default .cm-operator {color: black;}
  62. .cm-s-default .cm-comment {color: #a50;}
  63. .cm-s-default .cm-string {color: #a11;}
  64. .cm-s-default .cm-string-2 {color: #f50;}
  65. .cm-s-default .cm-meta {color: #555;}
  66. .cm-s-default .cm-qualifier {color: #555;}
  67. .cm-s-default .cm-builtin {color: #30a;}
  68. .cm-s-default .cm-bracket {color: #997;}
  69. .cm-s-default .cm-tag {color: #170;}
  70. .cm-s-default .cm-attribute {color: #00c;}
  71. .cm-s-default .cm-header {color: blue;}
  72. .cm-s-default .cm-quote {color: #090;}
  73. .cm-s-default .cm-hr {color: #999;}
  74. .cm-s-default .cm-link {color: #00c;}
  75. .cm-negative {color: #d44;}
  76. .cm-positive {color: #292;}
  77. .cm-header, .cm-strong {font-weight: bold;}
  78. .cm-em {font-style: italic;}
  79. .cm-link {text-decoration: underline;}
  80. .cm-s-default .cm-error {color: #f00;}
  81. .cm-invalidchar {color: #f00;}
  82. div.CodeMirror span.CodeMirror-matchingbracket {color: #0f0;}
  83. div.CodeMirror span.CodeMirror-nonmatchingbracket {color: #f22;}
  84. .CodeMirror-activeline-background {background: #e8f2ff;}
  85. /* STOP */
  86. /* The rest of this file contains styles related to the mechanics of
  87. the editor. You probably shouldn't touch them. */
  88. .CodeMirror {
  89. line-height: 1;
  90. position: relative;
  91. overflow: hidden;
  92. background: white;
  93. color: black;
  94. }
  95. .CodeMirror-scroll {
  96. /* 30px is the magic margin used to hide the element's real scrollbars */
  97. /* See overflow: hidden in .CodeMirror */
  98. margin-bottom: -30px; margin-right: -30px;
  99. padding-bottom: 30px; padding-right: 30px;
  100. height: 100%;
  101. outline: none; /* Prevent dragging from highlighting the element */
  102. position: relative;
  103. -moz-box-sizing: content-box;
  104. box-sizing: content-box;
  105. }
  106. .CodeMirror-sizer {
  107. position: relative;
  108. }
  109. /* The fake, visible scrollbars. Used to force redraw during scrolling
  110. before actuall scrolling happens, thus preventing shaking and
  111. flickering artifacts. */
  112. .CodeMirror-vscrollbar, .CodeMirror-hscrollbar, .CodeMirror-scrollbar-filler, .CodeMirror-gutter-filler {
  113. position: absolute;
  114. z-index: 6;
  115. display: none;
  116. }
  117. .CodeMirror-vscrollbar {
  118. right: 0; top: 0;
  119. overflow-x: hidden;
  120. overflow-y: scroll;
  121. }
  122. .CodeMirror-hscrollbar {
  123. bottom: 0; left: 0;
  124. overflow-y: hidden;
  125. overflow-x: scroll;
  126. }
  127. .CodeMirror-scrollbar-filler {
  128. right: 0; bottom: 0;
  129. }
  130. .CodeMirror-gutter-filler {
  131. left: 0; bottom: 0;
  132. }
  133. .CodeMirror-gutters {
  134. position: absolute; left: 0; top: 0;
  135. padding-bottom: 30px;
  136. z-index: 3;
  137. }
  138. .CodeMirror-gutter {
  139. white-space: normal;
  140. height: 100%;
  141. -moz-box-sizing: content-box;
  142. box-sizing: content-box;
  143. padding-bottom: 30px;
  144. margin-bottom: -32px;
  145. display: inline-block;
  146. /* Hack to make IE7 behave */
  147. *zoom:1;
  148. *display:inline;
  149. }
  150. .CodeMirror-gutter-elt {
  151. position: absolute;
  152. cursor: default;
  153. z-index: 4;
  154. }
  155. .CodeMirror-lines {
  156. cursor: text;
  157. }
  158. .CodeMirror pre {
  159. /* Reset some styles that the rest of the page might have set */
  160. -moz-border-radius: 0; -webkit-border-radius: 0; border-radius: 0;
  161. border-width: 0;
  162. background: transparent;
  163. font-family: inherit;
  164. font-size: inherit;
  165. margin: 0;
  166. white-space: pre;
  167. word-wrap: normal;
  168. line-height: inherit;
  169. color: inherit;
  170. z-index: 2;
  171. position: relative;
  172. overflow: visible;
  173. }
  174. .CodeMirror-wrap pre {
  175. word-wrap: break-word;
  176. white-space: pre-wrap;
  177. word-break: normal;
  178. }
  179. .CodeMirror-code pre {
  180. border-right: 30px solid transparent;
  181. width: -webkit-fit-content;
  182. width: -moz-fit-content;
  183. width: fit-content;
  184. }
  185. .CodeMirror-wrap .CodeMirror-code pre {
  186. border-right: none;
  187. width: auto;
  188. }
  189. .CodeMirror-linebackground {
  190. position: absolute;
  191. left: 0; right: 0; top: 0; bottom: 0;
  192. z-index: 0;
  193. }
  194. .CodeMirror-linewidget {
  195. position: relative;
  196. z-index: 2;
  197. overflow: auto;
  198. }
  199. .CodeMirror-widget {}
  200. .CodeMirror-wrap .CodeMirror-scroll {
  201. overflow-x: hidden;
  202. }
  203. .CodeMirror-measure {
  204. position: absolute;
  205. width: 100%;
  206. height: 0;
  207. overflow: hidden;
  208. visibility: hidden;
  209. }
  210. .CodeMirror-measure pre { position: static; }
  211. .CodeMirror div.CodeMirror-cursor {
  212. position: absolute;
  213. visibility: hidden;
  214. border-right: none;
  215. width: 0;
  216. }
  217. .CodeMirror-focused div.CodeMirror-cursor {
  218. visibility: visible;
  219. }
  220. .CodeMirror-selected { background: #d9d9d9; }
  221. .CodeMirror-focused .CodeMirror-selected { background: #d7d4f0; }
  222. .cm-searching {
  223. background: #ffa;
  224. background: rgba(255, 255, 0, .4);
  225. }
  226. /* IE7 hack to prevent it from returning funny offsetTops on the spans */
  227. .CodeMirror span { *vertical-align: text-bottom; }
  228. @media print {
  229. /* Hide the cursor when printing */
  230. .CodeMirror div.CodeMirror-cursor {
  231. visibility: hidden;
  232. }
  233. }