1
0

codemirror.css 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244
  1. /* BASICS */
  2. .CodeMirror {
  3. /* Set height, width, borders, and global font properties here */
  4. font-family: monospace;
  5. height: 300px;
  6. -webkit-border-radius: 10px;
  7. -moz-border-radius: 10px;
  8. border-radius: 10px;
  9. }
  10. .CodeMirror-scroll {
  11. /* Set scrolling behaviour here */
  12. overflow: auto;
  13. }
  14. /* PADDING */
  15. .CodeMirror-lines {
  16. padding: 4px 0; /* Vertical padding around content */
  17. }
  18. .CodeMirror pre {
  19. padding: 0 4px; /* Horizontal padding of content */
  20. }
  21. .CodeMirror-scrollbar-filler {
  22. background-color: white; /* The little square between H and V scrollbars */
  23. }
  24. /* GUTTER */
  25. .CodeMirror-gutters {
  26. border-right: 1px solid #ddd;
  27. background-color: #f7f7f7;
  28. }
  29. .CodeMirror-linenumbers {}
  30. .CodeMirror-linenumber {
  31. padding: 0 3px 0 5px;
  32. min-width: 20px;
  33. text-align: right;
  34. color: #999;
  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: transparent;
  48. background: rgba(0, 200, 0, .4);
  49. filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#6600c800, endColorstr=#4c00c800);
  50. }
  51. /* Kludge to turn off filter in ie9+, which also accepts rgba */
  52. .CodeMirror.cm-keymap-fat-cursor div.CodeMirror-cursor:not(#nonsense_id) {
  53. filter: progid:DXImageTransform.Microsoft.gradient(enabled=false);
  54. }
  55. /* Can style cursor different in overwrite (non-insert) mode */
  56. .CodeMirror div.CodeMirror-cursor.CodeMirror-overwrite {}
  57. /* DEFAULT THEME */
  58. .cm-s-default .cm-keyword {color: #708;}
  59. .cm-s-default .cm-atom {color: #219;}
  60. .cm-s-default .cm-number {color: #164;}
  61. .cm-s-default .cm-def {color: #00f;}
  62. .cm-s-default .cm-variable {color: black;}
  63. .cm-s-default .cm-variable-2 {color: #05a;}
  64. .cm-s-default .cm-variable-3 {color: #085;}
  65. .cm-s-default .cm-property {color: black;}
  66. .cm-s-default .cm-operator {color: black;}
  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-error {color: #f00;}
  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-emstrong {font-style: italic; font-weight: bold;}
  86. .cm-link {text-decoration: underline;}
  87. .cm-invalidchar {color: #f00;}
  88. div.CodeMirror span.CodeMirror-matchingbracket {color: #0f0;}
  89. div.CodeMirror span.CodeMirror-nonmatchingbracket {color: #f22;}
  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. }
  98. .CodeMirror-scroll {
  99. /* 30px is the magic margin used to hide the element's real scrollbars */
  100. /* See overflow: hidden in .CodeMirror, and the paddings in .CodeMirror-sizer */
  101. margin-bottom: -30px; margin-right: -30px;
  102. padding-bottom: 30px; padding-right: 30px;
  103. height: 100%;
  104. outline: none; /* Prevent dragging from highlighting the element */
  105. position: relative;
  106. }
  107. .CodeMirror-sizer {
  108. position: relative;
  109. }
  110. /* The fake, visible scrollbars. Used to force redraw during scrolling
  111. before actuall scrolling happens, thus preventing shaking and
  112. flickering artifacts. */
  113. .CodeMirror-vscrollbar, .CodeMirror-hscrollbar, .CodeMirror-scrollbar-filler {
  114. position: absolute;
  115. z-index: 6;
  116. display: none;
  117. }
  118. .CodeMirror-vscrollbar {
  119. right: 0; top: 0;
  120. overflow-x: hidden;
  121. overflow-y: scroll;
  122. }
  123. .CodeMirror-hscrollbar {
  124. bottom: 0; left: 0;
  125. overflow-y: hidden;
  126. overflow-x: scroll;
  127. }
  128. .CodeMirror-scrollbar-filler {
  129. right: 0; bottom: 0;
  130. z-index: 6;
  131. }
  132. .CodeMirror-gutters {
  133. position: absolute; left: 0; top: 0;
  134. height: 100%;
  135. z-index: 3;
  136. }
  137. .CodeMirror-gutter {
  138. height: 100%;
  139. display: inline-block;
  140. /* Hack to make IE7 behave */
  141. *zoom:1;
  142. *display:inline;
  143. }
  144. .CodeMirror-gutter-elt {
  145. position: absolute;
  146. cursor: default;
  147. z-index: 4;
  148. }
  149. .CodeMirror-lines {
  150. cursor: text;
  151. }
  152. .CodeMirror pre {
  153. /* Reset some styles that the rest of the page might have set */
  154. -moz-border-radius: 0; -webkit-border-radius: 0; -o-border-radius: 0; border-radius: 0;
  155. border-width: 0;
  156. background: transparent;
  157. font-family: inherit;
  158. font-size: inherit;
  159. margin: 0;
  160. white-space: pre;
  161. word-wrap: normal;
  162. line-height: inherit;
  163. color: inherit;
  164. z-index: 2;
  165. position: relative;
  166. overflow: visible;
  167. }
  168. .CodeMirror-wrap pre {
  169. word-wrap: break-word;
  170. white-space: pre-wrap;
  171. word-break: normal;
  172. }
  173. .CodeMirror-linebackground {
  174. position: absolute;
  175. left: 0; right: 0; top: 0; bottom: 0;
  176. z-index: 0;
  177. }
  178. .CodeMirror-linewidget {
  179. position: relative;
  180. z-index: 2;
  181. overflow: auto;
  182. }
  183. .CodeMirror-wrap .CodeMirror-scroll {
  184. overflow-x: hidden;
  185. }
  186. .CodeMirror-measure {
  187. position: absolute;
  188. width: 100%; height: 0px;
  189. overflow: hidden;
  190. visibility: hidden;
  191. }
  192. .CodeMirror-measure pre { position: static; }
  193. .CodeMirror div.CodeMirror-cursor {
  194. position: absolute;
  195. visibility: hidden;
  196. border-right: none;
  197. width: 0;
  198. }
  199. .CodeMirror-focused div.CodeMirror-cursor {
  200. visibility: visible;
  201. }
  202. .CodeMirror-selected { background: #d9d9d9; }
  203. .CodeMirror-focused .CodeMirror-selected { background: #d7d4f0; }
  204. .cm-searching {
  205. background: #ffa;
  206. background: rgba(255, 255, 0, .4);
  207. }
  208. /* IE7 hack to prevent it from returning funny offsetTops on the spans */
  209. .CodeMirror span { *vertical-align: text-bottom; }
  210. @media print {
  211. /* Hide the cursor when printing */
  212. .CodeMirror div.CodeMirror-cursor {
  213. visibility: hidden;
  214. }
  215. }