Brak opisu

header.scss 4.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203
  1. // Site header
  2. .site-header {
  3. @extend %responsive-alignwide-width;
  4. display: flex;
  5. align-items: flex-start;
  6. flex-wrap: wrap;
  7. row-gap: var(--global--spacing-vertical); // Add space in case the menu wraps below the site branding.
  8. .wp-custom-logo & {
  9. align-items: center;
  10. }
  11. @include media(mobile) {
  12. padding-top: calc(var(--global--spacing-vertical) / 0.75); // 40px
  13. }
  14. @include media(desktop) {
  15. padding-top: calc(2.4 * var(--global--spacing-vertical)); // 60px
  16. }
  17. }
  18. // Site branding
  19. .site-branding {
  20. color: var(--branding--color-text);
  21. margin-right: 140px;
  22. &:last-child {
  23. margin-right: 0;
  24. width: 100%;
  25. text-align: center;
  26. }
  27. @include media(mobile) {
  28. margin-right: initial;
  29. margin-top: 4px; // Align the baseline of the site title with the primary menu
  30. }
  31. }
  32. // Site title
  33. .site-title {
  34. color: var(--branding--color-link);
  35. font-family: var(--branding--title--font-family);
  36. font-size: var(--branding--title--font-size-mobile);
  37. letter-spacing: normal;
  38. text-transform: var(--branding--title--text-transform);
  39. line-height: var(--global--line-height-heading);
  40. margin-bottom: calc(var(--global--spacing-vertical) / 6);
  41. a {
  42. color: currentColor;
  43. font-weight: var(--branding--title--font-weight);
  44. &:link,
  45. &:visited,
  46. &:active {
  47. color: currentColor;
  48. }
  49. &:hover,
  50. &:focus {
  51. color: var(--branding--color-link-hover);
  52. }
  53. }
  54. @include media(mobile) {
  55. font-size: var(--branding--title--font-size);
  56. }
  57. }
  58. // Site description
  59. .site-description {
  60. color: currentColor;
  61. font-family: var(--branding--description--font-family);
  62. font-size: var(--branding--description--font-size);
  63. line-height: 1.4;
  64. }
  65. .site-title > a {
  66. text-decoration-color: var(--global--color-secondary);
  67. }
  68. // Site logo
  69. .site-logo {
  70. margin: calc(var(--global--spacing-vertical) / 2) 0;
  71. .site-header > & {
  72. width: 100%;
  73. padding-bottom: calc(var(--global--spacing-vertical) * 1.5);
  74. border-bottom: 1px solid;
  75. text-align: center;
  76. }
  77. .custom-logo {
  78. margin-left: auto;
  79. margin-right: auto;
  80. max-width: var(--branding--logo--max-width-mobile);
  81. max-height: var(--branding--logo--max-height-mobile);
  82. height: auto;
  83. display: inline-block;
  84. width: auto;
  85. }
  86. @include media(mobile) {
  87. .custom-logo {
  88. max-width: var(--branding--logo--max-width);
  89. max-height: var(--branding--logo--max-height);
  90. height: auto;
  91. width: auto;
  92. }
  93. }
  94. }
  95. @include media(mobile-only) {
  96. .site-header {
  97. &.has-logo {
  98. &:not(.has-title-and-tagline) {
  99. &.has-menu {
  100. .site-logo {
  101. position: absolute;
  102. padding-top: calc(0.5 * var(--global--spacing-vertical));
  103. margin-top: 0;
  104. top: var(--global--admin-bar--height);
  105. .primary-navigation-open & {
  106. display: none;
  107. }
  108. img {
  109. max-height: calc(var(--button--padding-vertical) - (0.25 * var(--global--spacing-unit)) + 1.7em);
  110. }
  111. }
  112. }
  113. }
  114. &.has-title-and-tagline {
  115. align-items: flex-start;
  116. &.has-menu {
  117. justify-content: space-between;
  118. .site-branding {
  119. max-width: calc(100% - 160px);
  120. }
  121. }
  122. .site-branding {
  123. margin-right: 0;
  124. }
  125. body:not(.primary-navigation-open) & {
  126. &:after {
  127. display: none;
  128. }
  129. .primary-navigation {
  130. position: relative;
  131. top: 0;
  132. }
  133. .menu-button-container {
  134. position: relative;
  135. padding-top: 0;
  136. margin-top: calc(0px - var(--button--padding-vertical) + (0.25 * var(--global--spacing-unit)));
  137. #primary-mobile-menu {
  138. // The 4.5px here is to offset the icon size horizontallly
  139. // (the icon's width is larger than the path's width and has extra space on the sides).
  140. padding-left: calc(var(--global--spacing-horizontal) * 0.6 - 4.5px);
  141. padding-right: calc(var(--global--spacing-horizontal) * 0.6 - 4.5px);
  142. margin-right: calc(0px - var(--global--spacing-horizontal) * 0.6);
  143. }
  144. }
  145. }
  146. }
  147. }
  148. &:not(.has-logo) {
  149. &.has-title-and-tagline {
  150. .site-branding {
  151. margin-right: 0;
  152. max-width: calc(100% - 160px);
  153. }
  154. }
  155. }
  156. &:not(.has-menu) {
  157. justify-content: center;
  158. }
  159. }
  160. }