codemirror.css 7.9 KB

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