site-header.css

Same filename in other branches
  1. 10 core/themes/olivero/css/components/site-header.css
  2. 11.x core/themes/olivero/css/components/site-header.css

Site header.

File

core/themes/olivero/css/components/site-header.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. * Site header.
  10. */
  11. .site-header {
  12. position: relative;
  13. /**
  14. * Ensure mobile site header is always above other elements including
  15. * contextual links, quick-edit, and Tour.
  16. */
  17. z-index: 101;
  18. }
  19. @media (min-width: 75rem) {
  20. .site-header {
  21. /* Necessary to keep the content from jumping up when header transitions to fixed. */
  22. min-height: 11.25rem;
  23. border-bottom: solid 1px transparent; /* Will show in Windows high contrast mode. */
  24. }
  25. }
  26. .site-header__initial {
  27. position: relative;
  28. z-index: 102;
  29. display: flex;
  30. align-items: flex-end;
  31. -ms-grid-row-align: stretch;
  32. align-self: stretch;
  33. background-color: #2494db;
  34. }
  35. .site-header__fixable {
  36. display: flex;
  37. align-items: flex-end;
  38. transition: all 0.5s;
  39. }
  40. @media (min-width: 75rem) {
  41. .site-header__fixable.is-fixed:not(.is-expanded) {
  42. pointer-events: none;
  43. }
  44. }
  45. @media (min-width: 75rem) {
  46. body:not(.is-always-mobile-nav) .site-header__fixable.is-fixed {
  47. position: fixed;
  48. z-index: 102; /* Appear above body content that is position: relative */
  49. top: -4.5rem;
  50. max-width: 98.125rem;
  51. }
  52. /* Toolbar is fixed, and tray is either vertical or closed and horizontal. */
  53. body.toolbar-vertical.toolbar-fixed:not(.is-always-mobile-nav) .site-header__fixable.is-fixed,
  54. body.toolbar-horizontal.toolbar-fixed:not(.is-always-mobile-nav) .site-header__fixable.is-fixed {
  55. top: -2.0625rem;
  56. }
  57. /* Toolbar is fixed, and tray is open and horizontal. */
  58. body.toolbar-horizontal.toolbar-fixed.toolbar-tray-open:not(.is-always-mobile-nav) .site-header__fixable.is-fixed {
  59. top: 0.4375rem;
  60. }
  61. }
  62. .site-header__inner {
  63. z-index: 1; /* Appear in front of Drupal's tabs. */
  64. flex-grow: 1;
  65. width: calc(100vw - 5.625rem);
  66. background: #fff;
  67. }
  68. /*
  69. * Only apply transition styles when JS is loaded. This
  70. * works around https://bugs.chromium.org/p/chromium/issues/detail?id=332189
  71. */
  72. @media (min-width: 75rem) {
  73. html.js body:not(.is-always-mobile-nav) .site-header__inner {
  74. transition: opacity 0.3s, transform 0.3s, box-shadow 0.3s;
  75. }
  76. }
  77. @media (min-width: 75rem) {
  78. .site-header__fixable.is-expanded .site-header__inner {
  79. box-shadow: -36px 1px 36px rgba(0, 0, 0, 0.08); /* LTR */
  80. }
  81. }
  82. @media (min-width: 75rem) {
  83. [dir="rtl"] .site-header__fixable.is-expanded .site-header__inner {
  84. box-shadow: 36px 1px 36px rgba(0, 0, 0, 0.08);
  85. }
  86. }
  87. /* Hide the desktop nav when it's fixed and not active. */
  88. @media (min-width: 75rem) {
  89. body:not(.is-always-mobile-nav) .site-header__fixable.is-fixed:not(.is-expanded) .site-header__inner {
  90. transform: translateX(-101%); /* LTR */
  91. opacity: 0;
  92. }
  93. }
  94. @media (min-width: 75rem) {
  95. [dir="rtl"] body:not(.is-always-mobile-nav) .site-header__fixable.is-fixed:not(.is-expanded) .site-header__inner {
  96. transform: translateX(101%);
  97. }
  98. }
  99. .site-header__inner__container {
  100. display: flex;
  101. justify-content: space-between;
  102. }

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