codemirror.css 8.3 KB

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