codemirror.css 7.5 KB

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