codemirror.css 7.9 KB

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