codemirror.css 5.9 KB

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