You are here

header-search-narrow.pcss.css in Drupal 9

Same filename and directory in other branches
  1. 10 core/themes/olivero/css/components/header-search-narrow.pcss.css

Header Search Narrow Block.

File

core/themes/olivero/css/components/header-search-narrow.pcss.css
View source
  1. /**
  2. * @file
  3. * Header Search Narrow Block.
  4. */
  5. @import "../base/variables.pcss.css";
  6. .block-search-narrow {
  7. margin-inline: calc(-1 * var(--sp));
  8. margin-block-end: var(--sp2);
  9. background: var(--color--black);
  10. & .search-block-form {
  11. display: flex;
  12. }
  13. & .form-item {
  14. flex-grow: 1;
  15. margin: 0;
  16. }
  17. & .form-actions {
  18. margin: 0;
  19. }
  20. & input[type="search"] {
  21. width: calc(100% + var(--sp2));
  22. height: calc(3 * var(--sp));
  23. padding-block: 0;
  24. padding-inline-start: var(--sp);
  25. padding-inline-end: var(--sp);
  26. transition: background-size 0.4s;
  27. color: var(--color--white);
  28. border: solid 1px transparent;
  29. background-color: transparent;
  30. background-image: linear-gradient(var(--color--blue-50), var(--color--blue-50)); /* Two values are needed for IE11 support. */
  31. background-repeat: no-repeat;
  32. background-position: bottom left; /* LTR */
  33. background-size: 0% 5px;
  34. box-shadow: none;
  35. font-family: serif;
  36. font-size: 16px;
  37. -webkit-appearance: none;
  38. &::-ms-clear {
  39. width: 40px;
  40. opacity: 0.5;
  41. }
  42. &:focus {
  43. outline: solid 4px transparent;
  44. outline-offset: -4px;
  45. background-size: 100% 5px;
  46. /*
  47. We normally indicate focus by animating background-image width. This isn't
  48. available in IE11 when in Windows high contrast mode.
  49. */
  50. @media screen and (-ms-high-contrast: active) {
  51. border-bottom-width: 5px;
  52. }
  53. }
  54. @media (--md) {
  55. padding-block: var(--sp2);
  56. padding-inline-start: var(--sp2);
  57. padding-inline-end: var(--sp2);
  58. }
  59. }
  60. & .search-form__submit {
  61. position: relative;
  62. overflow: hidden;
  63. align-self: stretch;
  64. width: var(--sp3);
  65. height: auto;
  66. margin-block: 0;
  67. margin-inline-start: 0;
  68. margin-inline-end: 0;
  69. padding-block: 0;
  70. padding-inline-start: 0;
  71. padding-inline-end: 0;
  72. cursor: pointer;
  73. border-color: transparent;
  74. background-color: transparent;
  75. /*
  76. When in Windows high contrast mode, FF will will not output either background
  77. images or SVGs that are nested directly within a
  78. */
  79. & .icon--search {
  80. position: absolute;
  81. inset-block-start: 0;
  82. inset-inline-start: 0;
  83. display: block;
  84. width: 100%; /* Width of the SVG background image. */
  85. height: 100%;
  86. pointer-events: none;
  87. background-image: url("../../images/search--white.svg");
  88. background-repeat: no-repeat;
  89. background-position: center;
  90. background-size: auto;
  91. &:after {
  92. position: absolute;
  93. inset-block-end: 0;
  94. inset-inline-start: 0;
  95. width: 100%;
  96. height: 0;
  97. content: "";
  98. transition: transform 0.2s;
  99. transform: scaleX(0);
  100. transform-origin: left; /* LTR */
  101. border-block-start: solid 5px var(--color--blue-50);
  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. @media screen and (-ms-high-contrast: active) {
  112. border-bottom-width: var(--sp0-5);
  113. & span:after {
  114. content: none;
  115. }
  116. }
  117. }
  118. @media (--md) {
  119. width: 80px;
  120. }
  121. @media screen and (-ms-high-contrast: active) {
  122. /* IE11's high contrast show will not show the background image, so we show the text. */
  123. & .visually-hidden {
  124. position: static;
  125. overflow: visible;
  126. clip: auto;
  127. width: auto;
  128. height: auto;
  129. text-align: center;
  130. }
  131. /* Edge's high contrast does show the background image, so we hide it. */
  132. & .icon--search {
  133. display: none;
  134. }
  135. }
  136. }
  137. /* 500px is the width of the primary nav at mobile. */
  138. @media (min-width: 500px) {
  139. margin-inline-start: 0;
  140. margin-inline-end: 0;
  141. }
  142. }
  143. body:not(.is-always-mobile-nav) .block-search-narrow {
  144. @media (--nav) {
  145. display: none;
  146. }
  147. }
  148. [dir="rtl"] .block-search-narrow {
  149. & input[type="search"] {
  150. background-position: bottom right;
  151. }
  152. & .search-form__submit .icon--search:after {
  153. transform-origin: right;
  154. }
  155. }