1
0

codemirror.css 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246
  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 {
  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. z-index: 3;
  37. }
  38. /* Shown when moving in bi-directional text */
  39. .CodeMirror div.CodeMirror-secondarycursor {
  40. border-left: 1px solid silver;
  41. }
  42. .CodeMirror.cm-keymap-fat-cursor div.CodeMirror-cursor {
  43. width: auto;
  44. border: 0;
  45. background: #7e7;
  46. z-index: 1;
  47. }
  48. /* Can style cursor different in overwrite (non-insert) mode */
  49. .CodeMirror div.CodeMirror-cursor.CodeMirror-overwrite {}
  50. .cm-tab { display: inline-block; }
  51. /* DEFAULT THEME */
  52. .cm-s-default .cm-keyword {color: #708;}
  53. .cm-s-default .cm-atom {color: #219;}
  54. .cm-s-default .cm-number {color: #164;}
  55. .cm-s-default .cm-def {color: #00f;}
  56. .cm-s-default .cm-variable {color: black;}
  57. .cm-s-default .cm-variable-2 {color: #05a;}
  58. .cm-s-default .cm-variable-3 {color: #085;}
  59. .cm-s-default .cm-property {color: black;}
  60. .cm-s-default .cm-operator {color: black;}
  61. .cm-s-default .cm-comment {color: #a50;}
  62. .cm-s-default .cm-string {color: #a11;}
  63. .cm-s-default .cm-string-2 {color: #f50;}
  64. .cm-s-default .cm-meta {color: #555;}
  65. .cm-s-default .cm-error {color: #f00;}
  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-invalidchar {color: #f00;}
  81. div.CodeMirror span.CodeMirror-matchingbracket {color: #0f0;}
  82. div.CodeMirror span.CodeMirror-nonmatchingbracket {color: #f22;}
  83. /* STOP */
  84. /* The rest of this file contains styles related to the mechanics of
  85. the editor. You probably shouldn't touch them. */
  86. .CodeMirror {
  87. line-height: 1;
  88. position: relative;
  89. overflow: hidden;
  90. background: white;
  91. color: black;
  92. }
  93. .CodeMirror-scroll {
  94. /* 30px is the magic margin used to hide the element's real scrollbars */
  95. /* See overflow: hidden in .CodeMirror, and the paddings in .CodeMirror-sizer */
  96. margin-bottom: -30px; margin-right: -30px;
  97. padding-bottom: 30px; padding-right: 30px;
  98. height: 100%;
  99. outline: none; /* Prevent dragging from highlighting the element */
  100. position: relative;
  101. }
  102. .CodeMirror-sizer {
  103. position: relative;
  104. }
  105. /* The fake, visible scrollbars. Used to force redraw during scrolling
  106. before actuall scrolling happens, thus preventing shaking and
  107. flickering artifacts. */
  108. .CodeMirror-vscrollbar, .CodeMirror-hscrollbar, .CodeMirror-scrollbar-filler {
  109. position: absolute;
  110. z-index: 6;
  111. display: none;
  112. }
  113. .CodeMirror-vscrollbar {
  114. right: 0; top: 0;
  115. overflow-x: hidden;
  116. overflow-y: scroll;
  117. }
  118. .CodeMirror-hscrollbar {
  119. bottom: 0; left: 0;
  120. overflow-y: hidden;
  121. overflow-x: scroll;
  122. }
  123. .CodeMirror-scrollbar-filler {
  124. right: 0; bottom: 0;
  125. z-index: 6;
  126. }
  127. .CodeMirror-gutters {
  128. position: absolute; left: 0; top: 0;
  129. height: 100%;
  130. padding-bottom: 30px;
  131. z-index: 3;
  132. }
  133. .CodeMirror-gutter {
  134. height: 100%;
  135. padding-bottom: 30px;
  136. margin-bottom: -32px;
  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; 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. }