header-search-wide.css

Header Search Wide Block.

File

core/themes/olivero/css/components/header-search-wide.css

View source
  1. /*
  2. * DO NOT EDIT THIS FILE.
  3. * See the following change record for more information,
  4. * https://www.drupal.org/node/3084859
  5. * @preserve
  6. */
  7. /**
  8. * @file
  9. * Header Search Wide Block.
  10. */
  11. /* Override contextual links so we can position against .site-header. */
  12. .block-search-wide.contextual-region {
  13. position: static;
  14. }
  15. .block-search-wide__wrapper {
  16. position: absolute;
  17. inset-block-start: 100%;
  18. inset-inline-start: calc(-1 * var(--content-left));
  19. display: none;
  20. visibility: hidden;
  21. overflow: hidden;
  22. width: calc(100% + var(--content-left));
  23. max-width: var(--max-bg-color);
  24. height: var(--sp8);
  25. max-height: 0;
  26. margin-block: 0;
  27. margin-inline-start: 0;
  28. margin-inline-end: 0;
  29. padding-block: 0;
  30. padding-inline-start: 0;
  31. padding-inline-end: 0;
  32. transition: all 0.2s;
  33. border-inline-start: solid var(--content-left) var(--color--gray-20);
  34. background: var(--color--black);
  35. &.is-active {
  36. visibility: visible;
  37. max-height: var(--sp8);
  38. }
  39. & form {
  40. display: flex;
  41. grid-column: 1 / 14;
  42. }
  43. & input[type="search"] {
  44. width: calc(100% + var(--sp2));
  45. height: var(--sp8);
  46. padding-block: 0;
  47. padding-inline-start: var(--sp12);
  48. padding-inline-end: 0;
  49. transition: background-size 0.4s;
  50. color: var(--color--white);
  51. border: solid 1px transparent;
  52. box-shadow: none;
  53. font-family: var(--font-serif);
  54. font-size: 2rem;
  55. -webkit-appearance: none;
  56. &:focus {
  57. outline: solid 4px transparent;
  58. outline-offset: -4px;
  59. }
  60. }
  61. & .form-item-keys {
  62. flex-grow: 1;
  63. margin: 0;
  64. }
  65. & .form-actions {
  66. display: flex;
  67. margin: 0;
  68. }
  69. & .search-form__submit {
  70. position: relative;
  71. overflow: hidden;
  72. align-self: stretch;
  73. width: 6.25rem;
  74. height: auto;
  75. margin-block: 0;
  76. margin-inline-start: 0;
  77. margin-inline-end: 0;
  78. padding-block: 0;
  79. padding-inline-start: 0;
  80. padding-inline-end: 0;
  81. cursor: pointer;
  82. border-color: transparent;
  83. background-color: transparent;
  84. /*
  85. When in Windows high contrast mode, FF will not output either background
  86. images or SVGs that are nested directly within a element, so we add a .
  87. */
  88. & .icon--search {
  89. position: absolute;
  90. inset-block-start: 0;
  91. inset-inline-end: 0;
  92. display: block;
  93. width: 1.5rem; /* Width of the SVG background image. */
  94. height: 100%;
  95. pointer-events: none;
  96. background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='26' height='27.2' viewBox='0 0 26 27.2'%3e %3cpath fill='%23fff' d='M25.8,25.5l-5.3-5.3c2.1-2.1,3.4-5.1,3.4-8.3C23.9,5.3,18.5,0,11.9,0C5.3,0,0,5.3,0,11.9c0,6.6,5.3,11.9,11.9,11.9c2.6,0,5.1-0.9,7-2.3l5.4,5.4c0.4,0.4,1,0.4,1.4,0C26.1,26.6,26.1,25.9,25.8,25.5z M11.9,21.9c-5.5,0-9.9-4.4-9.9-9.9S6.4,2,11.9,2c5.5,0,9.9,4.4,9.9,9.9S17.4,21.9,11.9,21.9z'/%3e%3c/svg%3e");
  97. background-repeat: no-repeat;
  98. background-position: center;
  99. background-size: contain;
  100. &::after {
  101. position: absolute;
  102. inset-block-end: 0;
  103. inset-inline-start: 0;
  104. width: 100%;
  105. height: 0;
  106. content: "";
  107. transition: transform 0.2s;
  108. transform: scaleX(0);
  109. transform-origin: left;
  110. border-block-start: solid var(--sp0-5) var(--color--primary-50);
  111. }
  112. }
  113. &:focus {
  114. outline: solid 4px transparent;
  115. outline-offset: -4px;
  116. box-shadow: none;
  117. & span::after {
  118. transform: scaleX(1);
  119. }
  120. }
  121. }
  122. }
  123. .block-search-wide__container {
  124. max-width: var(--max-width);
  125. padding-inline-end: var(--sp2);
  126. }
  127. .block-search-wide__grid {
  128. display: grid;
  129. grid-template-columns: repeat(var(--grid-col-count), 1fr);
  130. grid-column-gap: var(--grid-gap);
  131. }
  132. /* Override specificity from container-inline.module.css */
  133. .container-inline {
  134. & .block-search-wide__container {
  135. display: block;
  136. }
  137. & .block-search-wide__grid {
  138. display: grid;
  139. }
  140. }
  141. .block-search-wide__button {
  142. position: relative;
  143. display: none;
  144. width: var(--sp3);
  145. height: var(--sp6);
  146. cursor: pointer;
  147. color: var(--color-text-neutral-loud); /* Affects SVG search icon. */
  148. border: 0;
  149. background: transparent;
  150. -webkit-appearance: none;
  151. &:focus {
  152. position: relative;
  153. outline: 0;
  154. &::after {
  155. position: absolute;
  156. top: 50%;
  157. left: 50%;
  158. width: 80%;
  159. height: var(--sp3);
  160. content: "";
  161. transform: translate(-50%, -50%);
  162. border: solid 2px var(--color--primary-50);
  163. border-radius: 0.25rem;
  164. }
  165. }
  166. &[aria-expanded="true"] {
  167. background: var(--color--black);
  168. &:focus::after {
  169. border-color: var(--color--white);
  170. }
  171. & .block-search-wide__button-close {
  172. &::before,
  173. &::after {
  174. position: absolute;
  175. top: 50%;
  176. left: 50%;
  177. width: var(--sp1-5);
  178. height: 0;
  179. content: "";
  180. border-block-start: solid 2px var(--color--white);
  181. }
  182. &::before {
  183. transform: translate(-50%, -50%) rotate(-45deg);
  184. }
  185. &::after {
  186. transform: translate(-50%, -50%) rotate(45deg);
  187. }
  188. }
  189. & svg {
  190. display: none;
  191. }
  192. }
  193. & svg {
  194. margin-inline-start: auto;
  195. margin-inline-end: auto;
  196. }
  197. @media (forced-colors: active) {
  198. background: ButtonFace;
  199. & path {
  200. fill: ButtonText;
  201. }
  202. }
  203. }
  204. /* Provide rudimentary access to site search if JS is disabled. */
  205. html:not(.js) .search-block-form:focus-within .block-search-wide__wrapper {
  206. visibility: visible;
  207. max-height: var(--sp8);
  208. }
  209. /* Necessary to override specificity of transpiled PostCSS properties from default input focus styling. */
  210. [dir] .block-search-wide__wrapper input[type="search"] {
  211. background-color: transparent;
  212. background-image: linear-gradient(var(--color--primary-50));
  213. background-repeat: no-repeat;
  214. background-position: bottom left; /* LTR */
  215. background-size: 0% 0.625rem;
  216. &:focus {
  217. background-size: 100% var(--sp0-5);
  218. }
  219. }
  220. [dir="rtl"] .block-search-wide__wrapper {
  221. & input[type="search"] {
  222. background-position: bottom right;
  223. }
  224. & .search-form__submit .icon--search::after {
  225. transform-origin: right;
  226. }
  227. }
  228. body:not(.is-always-mobile-nav) {
  229. & .block-search-wide__wrapper,
  230. & .block-search-wide__button {
  231. @media (min-width: 75rem) {
  232. display: block;
  233. }
  234. }
  235. }

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.