codemirror.css 6.4 KB

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