codemirror.css 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173
  1. .CodeMirror {
  2. line-height: 1em;
  3. font-family: monospace;
  4. /* Necessary so the scrollbar can be absolutely positioned within the wrapper on Lion. */
  5. position: relative;
  6. /* This prevents unwanted scrollbars from showing up on the body and wrapper in IE. */
  7. overflow: hidden;
  8. }
  9. .CodeMirror-scroll {
  10. overflow: auto;
  11. height: 300px;
  12. /* This is needed to prevent an IE[67] bug where the scrolled content
  13. is visible outside of the scrolling box. */
  14. position: relative;
  15. outline: none;
  16. }
  17. /* Vertical scrollbar */
  18. .CodeMirror-scrollbar {
  19. position: absolute;
  20. right: 0; top: 0;
  21. overflow-x: hidden;
  22. overflow-y: scroll;
  23. z-index: 5;
  24. }
  25. .CodeMirror-scrollbar-inner {
  26. /* This needs to have a nonzero width in order for the scrollbar to appear
  27. in Firefox and IE9. */
  28. width: 1px;
  29. }
  30. .CodeMirror-scrollbar.cm-sb-overlap {
  31. /* Ensure that the scrollbar appears in Lion, and that it overlaps the content
  32. rather than sitting to the right of it. */
  33. position: absolute;
  34. z-index: 1;
  35. float: none;
  36. right: 0;
  37. min-width: 12px;
  38. }
  39. .CodeMirror-scrollbar.cm-sb-nonoverlap {
  40. min-width: 12px;
  41. }
  42. .CodeMirror-scrollbar.cm-sb-ie7 {
  43. min-width: 18px;
  44. }
  45. .CodeMirror-gutter {
  46. position: absolute; left: 0; top: 0;
  47. z-index: 10;
  48. background-color: #f7f7f7;
  49. border-right: 1px solid #eee;
  50. min-width: 2em;
  51. height: 100%;
  52. }
  53. .CodeMirror-gutter-text {
  54. color: #aaa;
  55. text-align: right;
  56. padding: .4em .2em .4em .4em;
  57. white-space: pre !important;
  58. cursor: default;
  59. }
  60. .CodeMirror-lines {
  61. padding: .4em;
  62. white-space: pre;
  63. cursor: text;
  64. }
  65. .CodeMirror pre {
  66. -moz-border-radius: 0;
  67. -webkit-border-radius: 0;
  68. -o-border-radius: 0;
  69. border-radius: 0;
  70. border-width: 0; margin: 0; padding: 0; background: transparent;
  71. font-family: inherit;
  72. font-size: inherit;
  73. padding: 0; margin: 0;
  74. white-space: pre;
  75. word-wrap: normal;
  76. line-height: inherit;
  77. color: inherit;
  78. }
  79. .CodeMirror-wrap pre {
  80. word-wrap: break-word;
  81. white-space: pre-wrap;
  82. word-break: normal;
  83. }
  84. .CodeMirror-wrap .CodeMirror-scroll {
  85. overflow-x: hidden;
  86. }
  87. .CodeMirror textarea {
  88. outline: none !important;
  89. }
  90. .CodeMirror pre.CodeMirror-cursor {
  91. z-index: 10;
  92. position: absolute;
  93. visibility: hidden;
  94. border-left: 1px solid black;
  95. border-right: none;
  96. width: 0;
  97. }
  98. .cm-keymap-fat-cursor pre.CodeMirror-cursor {
  99. width: auto;
  100. border: 0;
  101. background: transparent;
  102. background: rgba(0, 200, 0, .4);
  103. filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#6600c800, endColorstr=#4c00c800);
  104. }
  105. /* Kludge to turn off filter in ie9+, which also accepts rgba */
  106. .cm-keymap-fat-cursor pre.CodeMirror-cursor:not(#nonsense_id) {
  107. filter: progid:DXImageTransform.Microsoft.gradient(enabled=false);
  108. }
  109. .CodeMirror pre.CodeMirror-cursor.CodeMirror-overwrite {}
  110. .CodeMirror-focused pre.CodeMirror-cursor {
  111. visibility: visible;
  112. }
  113. div.CodeMirror-selected { background: #d9d9d9; }
  114. .CodeMirror-focused div.CodeMirror-selected { background: #d7d4f0; }
  115. .CodeMirror-searching {
  116. background: #ffa;
  117. background: rgba(255, 255, 0, .4);
  118. }
  119. /* Default theme */
  120. .cm-s-default span.cm-keyword {color: #708;}
  121. .cm-s-default span.cm-atom {color: #219;}
  122. .cm-s-default span.cm-number {color: #164;}
  123. .cm-s-default span.cm-def {color: #00f;}
  124. .cm-s-default span.cm-variable {color: black;}
  125. .cm-s-default span.cm-variable-2 {color: #05a;}
  126. .cm-s-default span.cm-variable-3 {color: #085;}
  127. .cm-s-default span.cm-property {color: black;}
  128. .cm-s-default span.cm-operator {color: black;}
  129. .cm-s-default span.cm-comment {color: #a50;}
  130. .cm-s-default span.cm-string {color: #a11;}
  131. .cm-s-default span.cm-string-2 {color: #f50;}
  132. .cm-s-default span.cm-meta {color: #555;}
  133. .cm-s-default span.cm-error {color: #f00;}
  134. .cm-s-default span.cm-qualifier {color: #555;}
  135. .cm-s-default span.cm-builtin {color: #30a;}
  136. .cm-s-default span.cm-bracket {color: #997;}
  137. .cm-s-default span.cm-tag {color: #170;}
  138. .cm-s-default span.cm-attribute {color: #00c;}
  139. .cm-s-default span.cm-header {color: blue;}
  140. .cm-s-default span.cm-quote {color: #090;}
  141. .cm-s-default span.cm-hr {color: #999;}
  142. .cm-s-default span.cm-link {color: #00c;}
  143. span.cm-header, span.cm-strong {font-weight: bold;}
  144. span.cm-em {font-style: italic;}
  145. span.cm-emstrong {font-style: italic; font-weight: bold;}
  146. span.cm-link {text-decoration: underline;}
  147. span.cm-invalidchar {color: #f00;}
  148. div.CodeMirror span.CodeMirror-matchingbracket {color: #0f0;}
  149. div.CodeMirror span.CodeMirror-nonmatchingbracket {color: #f22;}
  150. @media print {
  151. /* Hide the cursor when printing */
  152. .CodeMirror pre.CodeMirror-cursor {
  153. visibility: hidden;
  154. }
  155. }