codemirror.css 8.1 KB

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