1
0

codemirror.css 5.7 KB

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