codemirror.css 8.5 KB

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