codemirror.css 8.6 KB

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