global-search.css 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247
  1. #search-replace-dialog {
  2. position: fixed;
  3. top: 0;
  4. right: 64px;
  5. min-width: 200px;
  6. max-width: calc(100vw - 4rem);
  7. box-sizing: border-box;
  8. z-index: 10000;
  9. background-color: white;
  10. box-shadow: 4px 5px 20px -6px rgba(0, 0, 0, .5);
  11. border: 1px solid hsla(0, 0%, 50%, .4);
  12. transition: opacity .25s;
  13. border-top: none;
  14. }
  15. #search-replace-dialog:not(:focus-within):not(:hover) {
  16. opacity: .5;
  17. }
  18. #search-replace-dialog > * {
  19. padding-right: .75em;
  20. display: flex;
  21. align-items: stretch;
  22. background-color: hsla(0, 0%, 50%, .1);
  23. }
  24. #search-replace-dialog [data-type="content"] {
  25. flex: 1;
  26. display: flex;
  27. white-space: nowrap;
  28. }
  29. #search-replace-dialog [data-type="content"] > :not(:last-child) {
  30. margin-right: .5rem;
  31. }
  32. #search-replace-dialog [data-type="content"] button {
  33. align-self: center;
  34. }
  35. #search-replace-dialog[data-type="replace"] button svg {
  36. display: none;
  37. }
  38. #search-replace-dialog [data-type="input-wrapper"] {
  39. position: relative;
  40. display: flex;
  41. flex: 1;
  42. }
  43. #search-replace-dialog textarea {
  44. resize: none;
  45. width: min-content;
  46. min-width: 10em;
  47. max-width: none;
  48. min-height: 1.3em;
  49. max-height: 10vh;
  50. line-height: 1.3em;
  51. padding: .25rem .25rem .25rem .5rem;
  52. margin: 0;
  53. border: none;
  54. background-color: white;
  55. font-weight: bold;
  56. white-space: pre; /* issue #1000 */
  57. color: currentColor; /* use the current theme's color instead of UserAgent's CSS */
  58. flex: 1;
  59. }
  60. #search-replace-dialog textarea:invalid {
  61. box-shadow: none; /* Firefox is weird */
  62. }
  63. #search-replace-dialog :disabled {
  64. opacity: .5;
  65. }
  66. /*********** actions ****************/
  67. #search-replace-dialog [data-type="actions"] {
  68. flex: 0;
  69. display: flex;
  70. align-items: center;
  71. padding-left: .5em;
  72. opacity: .5;
  73. transition: opacity .25s;
  74. }
  75. #search-replace-dialog:focus-within [data-type="actions"],
  76. #search-replace-dialog [data-type="actions"]:hover {
  77. opacity: 1;
  78. }
  79. #search-replace-dialog [data-action] {
  80. display: block;
  81. padding: 2px .5em;
  82. }
  83. #search-replace-dialog [data-type="actions"] a:last-child {
  84. margin-right: -.5em;
  85. }
  86. /*********** case-sensitivity ****************/
  87. #search-replace-dialog [data-action="case"] {
  88. text-decoration: none;
  89. font-weight: bold;
  90. color: currentColor;
  91. cursor: pointer;
  92. padding: 0 .5em;
  93. line-height: 20px;
  94. display: block;
  95. position: relative;
  96. }
  97. #search-replace-dialog [data-action="case"][data-enabled]:after {
  98. content: "";
  99. left: 0;
  100. right: 0;
  101. bottom: 0;
  102. position: absolute;
  103. border-color: hsla(180, 100%, 30%, .5);
  104. border-style: none none solid none;
  105. border-width: 4px;
  106. }
  107. #search-replace-dialog [data-action="case"]:hover {
  108. text-decoration: underline;
  109. }
  110. /*********** clear input ****************/
  111. #search-replace-dialog textarea:not(:valid) + [data-type="hover"] {
  112. opacity: 0;
  113. pointer-events: none;
  114. }
  115. #search-replace-dialog [data-type="hover"] {
  116. display: flex;
  117. align-items: center;
  118. position: absolute;
  119. top: 0;
  120. right: 4px;
  121. bottom: 0;
  122. margin: 0;
  123. opacity: 0;
  124. pointer-events: none;
  125. transition: opacity .5s;
  126. }
  127. #search-replace-dialog:hover [data-type="hover"] {
  128. opacity: 1;
  129. pointer-events: auto;
  130. }
  131. #search-replace-dialog [data-action="clear"] {
  132. padding: 3px;
  133. width: 16px;
  134. height: 16px;
  135. box-sizing: border-box;
  136. display: flex;
  137. align-items: center;
  138. justify-content: center;
  139. background-color: hsla(0, 0%, 100%, .75);
  140. }
  141. #search-replace-dialog [data-type="status"] {
  142. background-color: hsla(0, 0%, 50%, .2);
  143. padding-top: 2px;
  144. padding-left: .5rem;
  145. display: flex;
  146. align-items: center;
  147. justify-content: space-between;
  148. }
  149. #search-replace-dialog [data-type="tally"] {
  150. opacity: .5;
  151. margin-left: 1em;
  152. }
  153. #search-replace-dialog [data-type="tally"]:hover {
  154. opacity: 1;
  155. }
  156. /*********** CM search highlight restyling, which shouldn't need color variables ****************/
  157. body.find-open .search-target-editor {
  158. box-shadow: 0 0 0 1px hsl(33, 100%, 50%), 0 0 3px hsla(33, 100%, 50%, .4);
  159. /* same as our global.css focus rule */
  160. }
  161. body.find-open .cm-searching {
  162. background-color: rgba(255, 255, 0, .4);
  163. }
  164. body.find-open .cm-searching.search-target-match {
  165. background-color: darkorange;
  166. color: black;
  167. }
  168. body.find-open .CodeMirror-search-match {
  169. background: gold;
  170. border-top: 1px solid orange;
  171. border-bottom: 1px solid orange;
  172. }
  173. /* hide default CM search highlight styling */
  174. body .cm-searching,
  175. body .CodeMirror-search-match {
  176. background-color: transparent;
  177. border-color: transparent;
  178. }
  179. @media (max-width: 500px) {
  180. #search-replace-dialog {
  181. left: 0;
  182. right: 0;
  183. max-width: none;
  184. }
  185. #search-replace-dialog textarea {
  186. min-width: 50px;
  187. }
  188. }
  189. @media (max-width: 800px) {
  190. #search-replace-dialog[data-type="replace"] {
  191. left: 0;
  192. right: 0;
  193. max-width: none;
  194. }
  195. #search-replace-dialog[data-type="replace"] button:not(.hidden) {
  196. display: none !important;
  197. }
  198. #search-replace-dialog[data-type="replace"] button.hidden {
  199. display: block !important;
  200. font-size: 0;
  201. width: 24px;
  202. text-align: center;
  203. cursor: pointer;
  204. }
  205. #search-replace-dialog[data-type="replace"] button svg {
  206. display: inline;
  207. }
  208. #search-replace-dialog[data-type="replace"] textarea {
  209. min-width: 50px;
  210. max-width: calc(50vw - 120px);
  211. width: auto;
  212. }
  213. }