You are here

site-header.pcss.css in Drupal 9

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

Site header.

File

core/themes/olivero/css/components/site-header.pcss.css
View source
  1. /**
  2. * @file
  3. * Site header.
  4. */
  5. @import "../base/variables.pcss.css";
  6. .site-header {
  7. position: relative;
  8. @media (--nav) {
  9. /* Necessary to keep the content from jumping up when header transitions to fixed. */
  10. min-height: var(--site-header-height-wide);
  11. border-block-end: solid 1px transparent; /* Will show in Windows high contrast mode. */
  12. }
  13. }
  14. .site-header__initial {
  15. position: relative;
  16. z-index: 102;
  17. display: flex;
  18. align-items: flex-end;
  19. align-self: stretch;
  20. background-color: var(--color--blue-50);
  21. }
  22. .site-header__fixable {
  23. display: flex;
  24. align-items: flex-end;
  25. transition: all 0.5s;
  26. &.is-fixed {
  27. @media (--nav) {
  28. &:not(.is-expanded) {
  29. pointer-events: none;
  30. }
  31. }
  32. }
  33. }
  34. @media (--nav) {
  35. body:not(.is-always-mobile-nav) {
  36. & .site-header__fixable.is-fixed {
  37. position: fixed;
  38. z-index: 102; /* Appear above body content that is position: relative */
  39. inset-block-start: calc(-1 * var(--sp4));
  40. max-width: var(--max-bg-color);
  41. }
  42. /* Toolbar is fixed, and tray is either vertical or closed and horizontal. */
  43. &.toolbar-vertical.toolbar-fixed,
  44. &.toolbar-horizontal.toolbar-fixed {
  45. & .site-header__fixable.is-fixed {
  46. inset-block-start: calc(var(--toolbar-height) - var(--sp4));
  47. }
  48. }
  49. /* Toolbar is fixed, and tray is open and horizontal. */
  50. &.toolbar-horizontal.toolbar-fixed.toolbar-tray-open .site-header__fixable.is-fixed {
  51. inset-block-start: calc(var(--toolbar-tray-height) + var(--toolbar-height) - var(--sp4));
  52. }
  53. }
  54. }
  55. .site-header__inner {
  56. flex-grow: 1;
  57. width: calc(100vw - var(--content-left));
  58. background: var(--color--white);
  59. }
  60. /*
  61. * Only apply transition styles when JS is loaded. This
  62. * works around https://bugs.chromium.org/p/chromium/issues/detail?id=332189
  63. */
  64. html.js body:not(.is-always-mobile-nav) .site-header__inner {
  65. @media (--nav) {
  66. transition: opacity 0.3s, transform 0.3s, box-shadow 0.3s;
  67. }
  68. }
  69. .site-header__fixable.is-expanded .site-header__inner {
  70. @media (--nav) {
  71. box-shadow: -36px 1px 36px rgba(0, 0, 0, 0.08); /* LTR */
  72. }
  73. }
  74. [dir="rtl"] .site-header__fixable.is-expanded .site-header__inner {
  75. @media (--nav) {
  76. box-shadow: 36px 1px 36px rgba(0, 0, 0, 0.08);
  77. }
  78. }
  79. /* Hide the desktop nav when it's fixed and not active. */
  80. body:not(.is-always-mobile-nav) .site-header__fixable.is-fixed:not(.is-expanded) .site-header__inner {
  81. @media (--nav) {
  82. transform: translateX(-101%); /* LTR */
  83. opacity: 0;
  84. }
  85. }
  86. [dir="rtl"] body:not(.is-always-mobile-nav) .site-header__fixable.is-fixed:not(.is-expanded) .site-header__inner {
  87. @media (--nav) {
  88. transform: translateX(101%);
  89. }
  90. }
  91. .site-header__inner__container {
  92. display: flex;
  93. justify-content: space-between;
  94. }