codemirror.css 7.4 KB

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