text-editor.less 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180
  1. @import "ui-variables";
  2. @import "octicon-utf-codes";
  3. @import "octicon-mixins";
  4. @import "utils.less";
  5. :root {
  6. // Fixes specs
  7. --editor-font-family: Menlo, Consolas, 'DejaVu Sans Mono', monospace;
  8. }
  9. atom-text-editor {
  10. contain: @contain_except_size;
  11. display: flex;
  12. cursor: text;
  13. font-family: var(--editor-font-family);
  14. font-size: var(--editor-font-size);
  15. line-height: var(--editor-line-height);
  16. .gutter-container {
  17. contain: @contain_except_size;
  18. width: min-content;
  19. background-color: inherit;
  20. cursor: default;
  21. }
  22. .gutter {
  23. contain: @contain_except_size;
  24. overflow: hidden;
  25. z-index: 0;
  26. text-align: right;
  27. min-width: 1em;
  28. box-sizing: border-box;
  29. background-color: inherit;
  30. position: relative;
  31. }
  32. .gutter:hover {
  33. .line-number.foldable .icon-right {
  34. contain: @contain_except_layout_size;
  35. visibility: visible;
  36. &:hover {
  37. opacity: 1;
  38. }
  39. }
  40. }
  41. .gutter, .gutter:hover {
  42. .line-number.folded .icon-right {
  43. contain: @contain_except_layout_size;
  44. .octicon(chevron-right, 0.8em);
  45. visibility: visible;
  46. &::before {
  47. position: relative;
  48. left: -.1em;
  49. }
  50. }
  51. }
  52. .line-numbers {
  53. contain: @contain_except_size;
  54. width: max-content;
  55. background-color: inherit;
  56. }
  57. .line-number {
  58. contain: @contain_except_size;
  59. padding-left: .5em;
  60. white-space: nowrap;
  61. opacity: 0.6;
  62. position: relative;
  63. .icon-right {
  64. contain: @contain_except_layout_size;
  65. .octicon(chevron-down, 0.8em);
  66. display: inline-block;
  67. visibility: hidden;
  68. opacity: .6;
  69. padding: 0 .4em;
  70. &::before {
  71. text-align: center;
  72. }
  73. }
  74. }
  75. .highlight {
  76. contain: @contain_except_paint;
  77. background: none;
  78. padding: 0;
  79. }
  80. .highlight .region {
  81. contain: @contain_except_paint;
  82. pointer-events: none;
  83. z-index: -1;
  84. }
  85. .selection .region {
  86. background-color: @syntax-selection-color;
  87. }
  88. .line {
  89. white-space: pre;
  90. contain: @contain_except_size;
  91. &.cursor-line .fold-marker::after {
  92. opacity: 1;
  93. }
  94. }
  95. .fold-marker {
  96. contain: @contain_all;
  97. cursor: default;
  98. &::after {
  99. .icon(0.8em, inline);
  100. content: @ellipsis;
  101. padding-left: 0.2em;
  102. }
  103. }
  104. .placeholder-text {
  105. contain: @contain_except_size;
  106. position: absolute;
  107. color: @text-color-subtle;
  108. }
  109. .invisible-character {
  110. contain: @contain_all;
  111. font-weight: normal !important;
  112. font-style: normal !important;
  113. }
  114. .indent-guide {
  115. contain: @contain_except_layout_size;
  116. display: inline-block;
  117. box-shadow: inset 1px 0;
  118. }
  119. .cursor {
  120. contain: @contain_all;
  121. z-index: 4;
  122. pointer-events: none;
  123. box-sizing: border-box;
  124. position: absolute;
  125. border-left: 1px solid;
  126. opacity: 0;
  127. }
  128. &.is-focused .cursor {
  129. opacity: 1;
  130. }
  131. .cursors.blink-off .cursor {
  132. opacity: 0;
  133. }
  134. // Atom manages the selection independent of Blink / the OS. We never want a
  135. // native selection.
  136. user-select: none;
  137. }
  138. atom-text-editor[mini] {
  139. contain: @contain_except_size;
  140. font-size: @input-font-size;
  141. line-height: @component-line-height;
  142. max-height: (@component-line-height + 2); // +2 for borders
  143. overflow: auto;
  144. }
  145. atom-overlay {
  146. contain: @contain_except_size_paint;
  147. position: fixed;
  148. display: block;
  149. z-index: 4;
  150. }