1
0

codemirror.css 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309
  1. /* BASICS */
  2. .CodeMirror {
  3. /* Set height, width, borders, and global font properties here */
  4. font-family: monospace;
  5. height: 300px;
  6. }
  7. /* PADDING */
  8. .CodeMirror-lines {
  9. padding: 4px 0; /* Vertical padding around content */
  10. }
  11. .CodeMirror pre {
  12. padding: 0 4px; /* Horizontal padding of content */
  13. }
  14. .CodeMirror-scrollbar-filler, .CodeMirror-gutter-filler {
  15. background-color: white; /* The little square between H and V scrollbars */
  16. }
  17. /* GUTTER */
  18. .CodeMirror-gutters {
  19. border-right: 1px solid #ddd;
  20. background-color: #f7f7f7;
  21. white-space: nowrap;
  22. }
  23. .CodeMirror-linenumbers {}
  24. .CodeMirror-linenumber {
  25. padding: 0 3px 0 5px;
  26. min-width: 20px;
  27. text-align: right;
  28. color: #999;
  29. -moz-box-sizing: content-box;
  30. box-sizing: content-box;
  31. }
  32. .CodeMirror-guttermarker { color: black; }
  33. .CodeMirror-guttermarker-subtle { color: #999; }
  34. /* CURSOR */
  35. .CodeMirror div.CodeMirror-cursor {
  36. border-left: 1px solid black;
  37. }
  38. /* Shown when moving in bi-directional text */
  39. .CodeMirror div.CodeMirror-secondarycursor {
  40. border-left: 1px solid silver;
  41. }
  42. .CodeMirror.cm-fat-cursor div.CodeMirror-cursor {
  43. width: auto;
  44. border: 0;
  45. background: #7e7;
  46. }
  47. .CodeMirror.cm-fat-cursor div.CodeMirror-cursors {
  48. z-index: 1;
  49. }
  50. .cm-animate-fat-cursor {
  51. width: auto;
  52. border: 0;
  53. -webkit-animation: blink 1.06s steps(1) infinite;
  54. -moz-animation: blink 1.06s steps(1) infinite;
  55. animation: blink 1.06s steps(1) infinite;
  56. }
  57. @-moz-keyframes blink {
  58. 0% { background: #7e7; }
  59. 50% { background: none; }
  60. 100% { background: #7e7; }
  61. }
  62. @-webkit-keyframes blink {
  63. 0% { background: #7e7; }
  64. 50% { background: none; }
  65. 100% { background: #7e7; }
  66. }
  67. @keyframes blink {
  68. 0% { background: #7e7; }
  69. 50% { background: none; }
  70. 100% { background: #7e7; }
  71. }
  72. /* Can style cursor different in overwrite (non-insert) mode */
  73. div.CodeMirror-overwrite div.CodeMirror-cursor {}
  74. .cm-tab { display: inline-block; text-decoration: inherit; }
  75. .CodeMirror-ruler {
  76. border-left: 1px solid #ccc;
  77. position: absolute;
  78. }
  79. /* DEFAULT THEME */
  80. .cm-s-default .cm-keyword {color: #708;}
  81. .cm-s-default .cm-atom {color: #219;}
  82. .cm-s-default .cm-number {color: #164;}
  83. .cm-s-default .cm-def {color: #00f;}
  84. .cm-s-default .cm-variable,
  85. .cm-s-default .cm-punctuation,
  86. .cm-s-default .cm-property,
  87. .cm-s-default .cm-operator {}
  88. .cm-s-default .cm-variable-2 {color: #05a;}
  89. .cm-s-default .cm-variable-3 {color: #085;}
  90. .cm-s-default .cm-comment {color: #a50;}
  91. .cm-s-default .cm-string {color: #a11;}
  92. .cm-s-default .cm-string-2 {color: #f50;}
  93. .cm-s-default .cm-meta {color: #555;}
  94. .cm-s-default .cm-qualifier {color: #555;}
  95. .cm-s-default .cm-builtin {color: #30a;}
  96. .cm-s-default .cm-bracket {color: #997;}
  97. .cm-s-default .cm-tag {color: #170;}
  98. .cm-s-default .cm-attribute {color: #00c;}
  99. .cm-s-default .cm-header {color: blue;}
  100. .cm-s-default .cm-quote {color: #090;}
  101. .cm-s-default .cm-hr {color: #999;}
  102. .cm-s-default .cm-link {color: #00c;}
  103. .cm-negative {color: #d44;}
  104. .cm-positive {color: #292;}
  105. .cm-header, .cm-strong {font-weight: bold;}
  106. .cm-em {font-style: italic;}
  107. .cm-link {text-decoration: underline;}
  108. .cm-strikethrough {text-decoration: line-through;}
  109. .cm-s-default .cm-error {color: #f00;}
  110. .cm-invalidchar {color: #f00;}
  111. /* Default styles for common addons */
  112. div.CodeMirror span.CodeMirror-matchingbracket {color: #0f0;}
  113. div.CodeMirror span.CodeMirror-nonmatchingbracket {color: #f22;}
  114. .CodeMirror-matchingtag { background: rgba(255, 150, 0, .3); }
  115. .CodeMirror-activeline-background {background: #e8f2ff;}
  116. /* STOP */
  117. /* The rest of this file contains styles related to the mechanics of
  118. the editor. You probably shouldn't touch them. */
  119. .CodeMirror {
  120. line-height: 1;
  121. position: relative;
  122. overflow: hidden;
  123. background: white;
  124. color: black;
  125. }
  126. .CodeMirror-scroll {
  127. overflow: scroll !important; /* Things will break if this is overridden */
  128. /* 30px is the magic margin used to hide the element's real scrollbars */
  129. /* See overflow: hidden in .CodeMirror */
  130. margin-bottom: -30px; margin-right: -30px;
  131. padding-bottom: 30px;
  132. height: 100%;
  133. outline: none; /* Prevent dragging from highlighting the element */
  134. position: relative;
  135. -moz-box-sizing: content-box;
  136. box-sizing: content-box;
  137. }
  138. .CodeMirror-sizer {
  139. position: relative;
  140. border-right: 30px solid transparent;
  141. -moz-box-sizing: content-box;
  142. box-sizing: content-box;
  143. }
  144. /* The fake, visible scrollbars. Used to force redraw during scrolling
  145. before actuall scrolling happens, thus preventing shaking and
  146. flickering artifacts. */
  147. .CodeMirror-vscrollbar, .CodeMirror-hscrollbar, .CodeMirror-scrollbar-filler, .CodeMirror-gutter-filler {
  148. position: absolute;
  149. z-index: 6;
  150. display: none;
  151. }
  152. .CodeMirror-vscrollbar {
  153. right: 0; top: 0;
  154. overflow-x: hidden;
  155. overflow-y: scroll;
  156. }
  157. .CodeMirror-hscrollbar {
  158. bottom: 0; left: 0;
  159. overflow-y: hidden;
  160. overflow-x: scroll;
  161. }
  162. .CodeMirror-scrollbar-filler {
  163. right: 0; bottom: 0;
  164. }
  165. .CodeMirror-gutter-filler {
  166. left: 0; bottom: 0;
  167. }
  168. .CodeMirror-gutters {
  169. position: absolute; left: 0; top: 0;
  170. z-index: 3;
  171. }
  172. .CodeMirror-gutter {
  173. white-space: normal;
  174. height: 100%;
  175. -moz-box-sizing: content-box;
  176. box-sizing: content-box;
  177. display: inline-block;
  178. margin-bottom: -30px;
  179. /* Hack to make IE7 behave */
  180. *zoom:1;
  181. *display:inline;
  182. }
  183. .CodeMirror-gutter-wrapper {
  184. position: absolute;
  185. z-index: 4;
  186. height: 100%;
  187. }
  188. .CodeMirror-gutter-elt {
  189. position: absolute;
  190. cursor: default;
  191. z-index: 4;
  192. }
  193. .CodeMirror-lines {
  194. cursor: text;
  195. min-height: 1px; /* prevents collapsing before first draw */
  196. }
  197. .CodeMirror pre {
  198. /* Reset some styles that the rest of the page might have set */
  199. -moz-border-radius: 0; -webkit-border-radius: 0; border-radius: 0;
  200. border-width: 0;
  201. background: transparent;
  202. font-family: inherit;
  203. font-size: inherit;
  204. margin: 0;
  205. white-space: pre;
  206. word-wrap: normal;
  207. line-height: inherit;
  208. color: inherit;
  209. z-index: 2;
  210. position: relative;
  211. overflow: visible;
  212. }
  213. .CodeMirror-wrap pre {
  214. word-wrap: break-word;
  215. white-space: pre-wrap;
  216. word-break: normal;
  217. }
  218. .CodeMirror-linebackground {
  219. position: absolute;
  220. left: 0; right: 0; top: 0; bottom: 0;
  221. z-index: 0;
  222. }
  223. .CodeMirror-linewidget {
  224. position: relative;
  225. z-index: 2;
  226. overflow: auto;
  227. }
  228. .CodeMirror-widget {}
  229. .CodeMirror-measure {
  230. position: absolute;
  231. width: 100%;
  232. height: 0;
  233. overflow: hidden;
  234. visibility: hidden;
  235. }
  236. .CodeMirror-measure pre { position: static; }
  237. .CodeMirror div.CodeMirror-cursor {
  238. position: absolute;
  239. border-right: none;
  240. width: 0;
  241. }
  242. div.CodeMirror-cursors {
  243. visibility: hidden;
  244. position: relative;
  245. z-index: 3;
  246. }
  247. .CodeMirror-focused div.CodeMirror-cursors {
  248. visibility: visible;
  249. }
  250. .CodeMirror-selected { background: #d9d9d9; }
  251. .CodeMirror-focused .CodeMirror-selected { background: #d7d4f0; }
  252. .CodeMirror-crosshair { cursor: crosshair; }
  253. .cm-searching {
  254. background: #ffa;
  255. background: rgba(255, 255, 0, .4);
  256. }
  257. /* IE7 hack to prevent it from returning funny offsetTops on the spans */
  258. .CodeMirror span { *vertical-align: text-bottom; }
  259. /* Used to force a border model for a node */
  260. .cm-force-border { padding-right: .1px; }
  261. @media print {
  262. /* Hide the cursor when printing */
  263. .CodeMirror div.CodeMirror-cursors {
  264. visibility: hidden;
  265. }
  266. }
  267. /* See issue #2901 */
  268. .cm-tab-wrap-hack:after { content: ''; }
  269. /* Help users use markselection to safely style text background */
  270. span.CodeMirror-selectedtext { background: none; }