codemirror.css 8.5 KB

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