codemirror.css 6.2 KB

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