header-search-narrow.css

Header Search Narrow Block.

File

core/themes/olivero/css/components/header-search-narrow.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 Narrow Block.
  10. */
  11. .block-search-narrow {
  12. margin-inline: calc(-1 * var(--sp));
  13. margin-block-end: var(--sp2);
  14. background: var(--color--black);
  15. & .search-block-form {
  16. display: flex;
  17. }
  18. & .form-item {
  19. flex-grow: 1;
  20. margin: 0;
  21. }
  22. & .form-actions {
  23. margin: 0;
  24. }
  25. & input[type="search"] {
  26. width: calc(100% + var(--sp2));
  27. height: var(--sp3);
  28. padding-block: 0;
  29. padding-inline-start: var(--sp);
  30. padding-inline-end: var(--sp);
  31. transition: background-size 0.4s;
  32. color: var(--color--white);
  33. border: solid 1px transparent;
  34. background-color: transparent;
  35. background-image: linear-gradient(var(--color--primary-50));
  36. background-repeat: no-repeat;
  37. background-position: bottom left; /* LTR */
  38. background-size: 0% 0.3125rem;
  39. box-shadow: none;
  40. font-family: var(--font-serif);
  41. font-size: 1rem;
  42. -webkit-appearance: none;
  43. &:focus {
  44. outline: solid 4px transparent;
  45. outline-offset: -4px;
  46. background-size: 100% 0.3125rem;
  47. }
  48. @media (min-width: 43.75rem) {
  49. height: var(--sp4);
  50. padding-inline-start: var(--sp2);
  51. padding-inline-end: var(--sp2);
  52. }
  53. }
  54. & .search-form__submit {
  55. position: relative;
  56. overflow: hidden;
  57. align-self: stretch;
  58. width: var(--sp3);
  59. height: auto;
  60. margin-block: 0;
  61. margin-inline-start: 0;
  62. margin-inline-end: 0;
  63. padding-block: 0;
  64. padding-inline-start: 0;
  65. padding-inline-end: 0;
  66. cursor: pointer;
  67. border-color: transparent;
  68. background-color: transparent;
  69. /*
  70. When in Windows high contrast mode, FF will not output either background
  71. images or SVGs that are nested directly within a element, so we add a .
  72. */
  73. & .icon--search {
  74. position: absolute;
  75. inset-block-start: 0;
  76. inset-inline-start: 0;
  77. display: block;
  78. width: 100%; /* Width of the SVG background image. */
  79. height: 100%;
  80. pointer-events: none;
  81. 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");
  82. background-repeat: no-repeat;
  83. background-position: center;
  84. background-size: auto;
  85. &::after {
  86. position: absolute;
  87. inset-block-end: 0;
  88. inset-inline-start: 0;
  89. width: 100%;
  90. height: 0;
  91. content: "";
  92. transition: transform 0.2s;
  93. transform: scaleX(0);
  94. transform-origin: left; /* LTR */
  95. border-block-start: solid 0.3125rem var(--color--primary-50);
  96. }
  97. @media (forced-colors: active) {
  98. background: buttontext;
  99. mask-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");
  100. mask-repeat: no-repeat;
  101. mask-position: center;
  102. }
  103. }
  104. &:focus {
  105. outline: solid 4px transparent;
  106. outline-offset: -4px;
  107. box-shadow: none;
  108. & span::after {
  109. transform: scaleX(1);
  110. }
  111. }
  112. @media (min-width: 43.75rem) {
  113. width: 5rem;
  114. }
  115. }
  116. /* 500px is the width of the primary nav at mobile. */
  117. @media (min-width: 31.25rem) {
  118. margin-inline-start: 0;
  119. margin-inline-end: 0;
  120. }
  121. }
  122. body:not(.is-always-mobile-nav) .block-search-narrow {
  123. @media (min-width: 75rem) {
  124. display: none;
  125. }
  126. }
  127. [dir="rtl"] .block-search-narrow {
  128. & input[type="search"] {
  129. background-position: bottom right;
  130. }
  131. & .search-form__submit .icon--search::after {
  132. transform-origin: right;
  133. }
  134. }

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