1
0

codemirror.css 7.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334
  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. z-index: 3;
  169. }
  170. .CodeMirror-gutter {
  171. white-space: normal;
  172. height: 100%;
  173. display: inline-block;
  174. margin-bottom: -30px;
  175. /* Hack to make IE7 behave */
  176. *zoom:1;
  177. *display:inline;
  178. }
  179. .CodeMirror-gutter-wrapper {
  180. position: absolute;
  181. z-index: 4;
  182. background: none !important;
  183. border: none !important;
  184. }
  185. .CodeMirror-gutter-background {
  186. position: absolute;
  187. top: 0; bottom: 0;
  188. z-index: 4;
  189. }
  190. .CodeMirror-gutter-elt {
  191. position: absolute;
  192. cursor: default;
  193. z-index: 4;
  194. }
  195. .CodeMirror-gutter-wrapper {
  196. -webkit-user-select: none;
  197. -moz-user-select: none;
  198. user-select: none;
  199. }
  200. .CodeMirror-lines {
  201. cursor: text;
  202. min-height: 1px; /* prevents collapsing before first draw */
  203. }
  204. .CodeMirror pre {
  205. /* Reset some styles that the rest of the page might have set */
  206. -moz-border-radius: 0; -webkit-border-radius: 0; border-radius: 0;
  207. border-width: 0;
  208. background: transparent;
  209. font-family: inherit;
  210. font-size: inherit;
  211. margin: 0;
  212. white-space: pre;
  213. word-wrap: normal;
  214. line-height: inherit;
  215. color: inherit;
  216. z-index: 2;
  217. position: relative;
  218. overflow: visible;
  219. -webkit-tap-highlight-color: transparent;
  220. }
  221. .CodeMirror-wrap pre {
  222. word-wrap: break-word;
  223. white-space: pre-wrap;
  224. word-break: normal;
  225. }
  226. .CodeMirror-linebackground {
  227. position: absolute;
  228. left: 0; right: 0; top: 0; bottom: 0;
  229. z-index: 0;
  230. }
  231. .CodeMirror-linewidget {
  232. position: relative;
  233. z-index: 2;
  234. overflow: auto;
  235. }
  236. .CodeMirror-widget {}
  237. .CodeMirror-code {
  238. outline: none;
  239. }
  240. /* Force content-box sizing for the elements where we expect it */
  241. .CodeMirror-scroll,
  242. .CodeMirror-sizer,
  243. .CodeMirror-gutter,
  244. .CodeMirror-gutters,
  245. .CodeMirror-linenumber {
  246. -moz-box-sizing: content-box;
  247. box-sizing: content-box;
  248. }
  249. .CodeMirror-measure {
  250. position: absolute;
  251. width: 100%;
  252. height: 0;
  253. overflow: hidden;
  254. visibility: hidden;
  255. }
  256. .CodeMirror-cursor { position: absolute; }
  257. .CodeMirror-measure pre { position: static; }
  258. div.CodeMirror-cursors {
  259. visibility: hidden;
  260. position: relative;
  261. z-index: 3;
  262. }
  263. div.CodeMirror-dragcursors {
  264. visibility: visible;
  265. }
  266. .CodeMirror-focused div.CodeMirror-cursors {
  267. visibility: visible;
  268. }
  269. .CodeMirror-selected { background: #d9d9d9; }
  270. .CodeMirror-focused .CodeMirror-selected { background: #d7d4f0; }
  271. .CodeMirror-crosshair { cursor: crosshair; }
  272. .CodeMirror-line::selection, .CodeMirror-line > span::selection, .CodeMirror-line > span > span::selection { background: #d7d4f0; }
  273. .CodeMirror-line::-moz-selection, .CodeMirror-line > span::-moz-selection, .CodeMirror-line > span > span::-moz-selection { background: #d7d4f0; }
  274. .cm-searching {
  275. background: #ffa;
  276. background: rgba(255, 255, 0, .4);
  277. }
  278. /* IE7 hack to prevent it from returning funny offsetTops on the spans */
  279. .CodeMirror span { *vertical-align: text-bottom; }
  280. /* Used to force a border model for a node */
  281. .cm-force-border { padding-right: .1px; }
  282. @media print {
  283. /* Hide the cursor when printing */
  284. .CodeMirror div.CodeMirror-cursors {
  285. visibility: hidden;
  286. }
  287. }
  288. /* See issue #2901 */
  289. .cm-tab-wrap-hack:after { content: ''; }
  290. /* Help users use markselection to safely style text background */
  291. span.CodeMirror-selectedtext { background: none; }