codemirror.css 8.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343
  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 .CodeMirror-line::selection,
  55. .cm-fat-cursor .CodeMirror-line > span::selection,
  56. .cm-fat-cursor .CodeMirror-line > span > span::selection { background: transparent; }
  57. .cm-fat-cursor .CodeMirror-line::-moz-selection,
  58. .cm-fat-cursor .CodeMirror-line > span::-moz-selection,
  59. .cm-fat-cursor .CodeMirror-line > span > span::-moz-selection { background: transparent; }
  60. .cm-fat-cursor { caret-color: transparent; }
  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: 0;
  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: #0b0;}
  124. div.CodeMirror span.CodeMirror-nonmatchingbracket {color: #a22;}
  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. /* 50px is the magic margin used to hide the element's real scrollbars */
  138. /* See overflow: hidden in .CodeMirror */
  139. margin-bottom: -50px; margin-right: -50px;
  140. padding-bottom: 50px;
  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: 50px 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. outline: none;
  157. }
  158. .CodeMirror-vscrollbar {
  159. right: 0; top: 0;
  160. overflow-x: hidden;
  161. overflow-y: scroll;
  162. }
  163. .CodeMirror-hscrollbar {
  164. bottom: 0; left: 0;
  165. overflow-y: hidden;
  166. overflow-x: scroll;
  167. }
  168. .CodeMirror-scrollbar-filler {
  169. right: 0; bottom: 0;
  170. }
  171. .CodeMirror-gutter-filler {
  172. left: 0; bottom: 0;
  173. }
  174. .CodeMirror-gutters {
  175. position: absolute; left: 0; top: 0;
  176. min-height: 100%;
  177. z-index: 3;
  178. }
  179. .CodeMirror-gutter {
  180. white-space: normal;
  181. height: 100%;
  182. display: inline-block;
  183. vertical-align: top;
  184. margin-bottom: -50px;
  185. }
  186. .CodeMirror-gutter-wrapper {
  187. position: absolute;
  188. z-index: 4;
  189. background: none !important;
  190. border: none !important;
  191. }
  192. .CodeMirror-gutter-background {
  193. position: absolute;
  194. top: 0; bottom: 0;
  195. z-index: 4;
  196. }
  197. .CodeMirror-gutter-elt {
  198. position: absolute;
  199. cursor: default;
  200. z-index: 4;
  201. }
  202. .CodeMirror-gutter-wrapper ::selection { background-color: transparent }
  203. .CodeMirror-gutter-wrapper ::-moz-selection { background-color: transparent }
  204. .CodeMirror-lines {
  205. cursor: text;
  206. min-height: 1px; /* prevents collapsing before first draw */
  207. }
  208. .CodeMirror pre.CodeMirror-line,
  209. .CodeMirror pre.CodeMirror-line-like {
  210. /* Reset some styles that the rest of the page might have set */
  211. -moz-border-radius: 0; -webkit-border-radius: 0; border-radius: 0;
  212. border-width: 0;
  213. background: transparent;
  214. font-family: inherit;
  215. font-size: inherit;
  216. margin: 0;
  217. white-space: pre;
  218. word-wrap: normal;
  219. line-height: inherit;
  220. color: inherit;
  221. z-index: 2;
  222. position: relative;
  223. overflow: visible;
  224. -webkit-tap-highlight-color: transparent;
  225. -webkit-font-variant-ligatures: contextual;
  226. font-variant-ligatures: contextual;
  227. }
  228. .CodeMirror-wrap pre.CodeMirror-line,
  229. .CodeMirror-wrap pre.CodeMirror-line-like {
  230. word-wrap: break-word;
  231. white-space: pre-wrap;
  232. word-break: normal;
  233. }
  234. .CodeMirror-linebackground {
  235. position: absolute;
  236. left: 0; right: 0; top: 0; bottom: 0;
  237. z-index: 0;
  238. }
  239. .CodeMirror-linewidget {
  240. position: relative;
  241. z-index: 2;
  242. padding: 0.1px; /* Force widget margins to stay inside of the container */
  243. }
  244. .CodeMirror-widget {}
  245. .CodeMirror-rtl pre { direction: rtl; }
  246. .CodeMirror-code {
  247. outline: none;
  248. }
  249. /* Force content-box sizing for the elements where we expect it */
  250. .CodeMirror-scroll,
  251. .CodeMirror-sizer,
  252. .CodeMirror-gutter,
  253. .CodeMirror-gutters,
  254. .CodeMirror-linenumber {
  255. -moz-box-sizing: content-box;
  256. box-sizing: content-box;
  257. }
  258. .CodeMirror-measure {
  259. position: absolute;
  260. width: 100%;
  261. height: 0;
  262. overflow: hidden;
  263. visibility: hidden;
  264. }
  265. .CodeMirror-cursor {
  266. position: absolute;
  267. pointer-events: none;
  268. }
  269. .CodeMirror-measure pre { position: static; }
  270. div.CodeMirror-cursors {
  271. visibility: hidden;
  272. position: relative;
  273. z-index: 3;
  274. }
  275. div.CodeMirror-dragcursors {
  276. visibility: visible;
  277. }
  278. .CodeMirror-focused div.CodeMirror-cursors {
  279. visibility: visible;
  280. }
  281. .CodeMirror-selected { background: #d9d9d9; }
  282. .CodeMirror-focused .CodeMirror-selected { background: #d7d4f0; }
  283. .CodeMirror-crosshair { cursor: crosshair; }
  284. .CodeMirror-line::selection, .CodeMirror-line > span::selection, .CodeMirror-line > span > span::selection { background: #d7d4f0; }
  285. .CodeMirror-line::-moz-selection, .CodeMirror-line > span::-moz-selection, .CodeMirror-line > span > span::-moz-selection { background: #d7d4f0; }
  286. .cm-searching {
  287. background-color: #ffa;
  288. background-color: rgba(255, 255, 0, .4);
  289. }
  290. /* Used to force a border model for a node */
  291. .cm-force-border { padding-right: .1px; }
  292. @media print {
  293. /* Hide the cursor when printing */
  294. .CodeMirror div.CodeMirror-cursors {
  295. visibility: hidden;
  296. }
  297. }
  298. /* See issue #2901 */
  299. .cm-tab-wrap-hack:after { content: ''; }
  300. /* Help users use markselection to safely style text background */
  301. span.CodeMirror-selectedtext { background: none; }