codemirror.css 6.0KB

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