codemirror.css 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326
  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. font-family: monospace;
  135. }
  136. .CodeMirror-sizer {
  137. position: relative;
  138. border-right: 30px solid transparent;
  139. }
  140. /* The fake, visible scrollbars. Used to force redraw during scrolling
  141. before actuall scrolling happens, thus preventing shaking and
  142. flickering artifacts. */
  143. .CodeMirror-vscrollbar, .CodeMirror-hscrollbar, .CodeMirror-scrollbar-filler, .CodeMirror-gutter-filler {
  144. position: absolute;
  145. z-index: 6;
  146. display: none;
  147. }
  148. .CodeMirror-vscrollbar {
  149. right: 0; top: 0;
  150. overflow-x: hidden;
  151. overflow-y: scroll;
  152. }
  153. .CodeMirror-hscrollbar {
  154. bottom: 0; left: 0;
  155. overflow-y: hidden;
  156. overflow-x: scroll;
  157. }
  158. .CodeMirror-scrollbar-filler {
  159. right: 0; bottom: 0;
  160. }
  161. .CodeMirror-gutter-filler {
  162. left: 0; bottom: 0;
  163. }
  164. .CodeMirror-gutters {
  165. position: absolute; left: 0; top: 0;
  166. z-index: 3;
  167. }
  168. .CodeMirror-gutter {
  169. white-space: normal;
  170. height: 100%;
  171. display: inline-block;
  172. margin-bottom: -30px;
  173. /* Hack to make IE7 behave */
  174. *zoom:1;
  175. *display:inline;
  176. }
  177. .CodeMirror-gutter-wrapper {
  178. position: absolute;
  179. z-index: 4;
  180. height: 100%;
  181. }
  182. .CodeMirror-gutter-elt {
  183. position: absolute;
  184. cursor: default;
  185. z-index: 4;
  186. }
  187. .CodeMirror-gutter-wrapper {
  188. -webkit-user-select: none;
  189. -moz-user-select: none;
  190. user-select: none;
  191. }
  192. .CodeMirror-lines {
  193. cursor: text;
  194. min-height: 1px; /* prevents collapsing before first draw */
  195. }
  196. .CodeMirror pre {
  197. /* Reset some styles that the rest of the page might have set */
  198. -moz-border-radius: 0; -webkit-border-radius: 0; border-radius: 0;
  199. border-width: 0;
  200. background: transparent;
  201. font-family: inherit;
  202. font-size: inherit;
  203. margin: 0;
  204. white-space: pre;
  205. word-wrap: normal;
  206. line-height: inherit;
  207. color: inherit;
  208. z-index: 2;
  209. position: relative;
  210. overflow: visible;
  211. -webkit-tap-highlight-color: transparent;
  212. }
  213. .CodeMirror-wrap pre {
  214. word-wrap: break-word;
  215. white-space: pre-wrap;
  216. word-break: normal;
  217. }
  218. .CodeMirror-linebackground {
  219. position: absolute;
  220. left: 0; right: 0; top: 0; bottom: 0;
  221. z-index: 0;
  222. }
  223. .CodeMirror-linewidget {
  224. position: relative;
  225. z-index: 2;
  226. overflow: auto;
  227. }
  228. .CodeMirror-widget {}
  229. .CodeMirror-code {
  230. outline: none;
  231. }
  232. /* Force content-box sizing for the elements where we expect it */
  233. .CodeMirror-scroll,
  234. .CodeMirror-sizer,
  235. .CodeMirror-gutter,
  236. .CodeMirror-gutters,
  237. .CodeMirror-linenumber {
  238. -moz-box-sizing: content-box;
  239. box-sizing: content-box;
  240. }
  241. .CodeMirror-measure {
  242. position: absolute;
  243. width: 100%;
  244. height: 0;
  245. overflow: hidden;
  246. visibility: hidden;
  247. }
  248. .CodeMirror-measure pre { position: static; }
  249. .CodeMirror div.CodeMirror-cursor {
  250. position: absolute;
  251. border-right: none;
  252. width: 0;
  253. }
  254. div.CodeMirror-cursors {
  255. visibility: hidden;
  256. position: relative;
  257. z-index: 3;
  258. }
  259. .CodeMirror-focused div.CodeMirror-cursors {
  260. visibility: visible;
  261. }
  262. .CodeMirror-selected { background: #d9d9d9; }
  263. .CodeMirror-focused .CodeMirror-selected { background: #d7d4f0; }
  264. .CodeMirror-crosshair { cursor: crosshair; }
  265. .CodeMirror ::selection { background: #d7d4f0; }
  266. .CodeMirror ::-moz-selection { background: #d7d4f0; }
  267. .cm-searching {
  268. background: #ffa;
  269. background: rgba(255, 255, 0, .4);
  270. }
  271. /* IE7 hack to prevent it from returning funny offsetTops on the spans */
  272. .CodeMirror span { *vertical-align: text-bottom; }
  273. /* Used to force a border model for a node */
  274. .cm-force-border { padding-right: .1px; }
  275. @media print {
  276. /* Hide the cursor when printing */
  277. .CodeMirror div.CodeMirror-cursors {
  278. visibility: hidden;
  279. }
  280. }
  281. /* See issue #2901 */
  282. .cm-tab-wrap-hack:after { content: ''; }
  283. /* Help users use markselection to safely style text background */
  284. span.CodeMirror-selectedtext { background: none; }