codemirror.css 7.9 KB

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