_site-mobile-nav-side.scss 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164
  1. $wpcom-marketing-bar--height: 45px;
  2. $wpadmin-bar--height: 46px;
  3. // Updates the Mobile Navigation to be next to the site title.
  4. @include media(mobile-only) {
  5. .mobile-nav-side {
  6. .has-menu {
  7. &:before,
  8. &:after {
  9. content: none;
  10. }
  11. position: relative;
  12. display: grid;
  13. grid-gap: 2px;
  14. grid-template-areas:
  15. "site-logo site-logo"
  16. "social-navigation main-navigation";
  17. &.has-title-and-tagline {
  18. grid-template-areas:
  19. "site-logo site-logo"
  20. "site-title main-navigation"
  21. "site-description main-navigation"
  22. "social-navigation social-navigation";
  23. .site-title {
  24. grid-area: site-title;
  25. align-self: end;
  26. }
  27. .site-description {
  28. grid-area: site-description;
  29. align-self: start;
  30. }
  31. }
  32. & > *:not(.site-logo) {
  33. margin: 0;
  34. }
  35. .site-logo {
  36. grid-area: site-logo;
  37. justify-self: center;
  38. margin: $baseline-unit 0;
  39. }
  40. .social-navigation {
  41. grid-area: social-navigation;
  42. align-self: center;
  43. }
  44. .main-navigation {
  45. grid-area: main-navigation;
  46. }
  47. }
  48. .site-header #site-navigation.main-navigation {
  49. margin: 0;
  50. justify-self: end;
  51. display: flex;
  52. align-items: flex-start;
  53. justify-content: end;
  54. #woocommerce-toggle,
  55. #toggle {
  56. &:checked + label{
  57. position: fixed;
  58. top: 2 * $baseline-unit + 2px;
  59. right: 2 * $baseline-unit;
  60. z-index: 20000;
  61. margin-right: 0;
  62. }
  63. }
  64. #toggle-menu {
  65. order: 2;
  66. grid-area: menu-toggle;
  67. }
  68. #toggle-cart[for="woocommerce-toggle"] {
  69. order: 1;
  70. grid-area: cart-toggle;
  71. margin-right: $baseline-unit;
  72. }
  73. #toggle-cart[for="woocommerce-toggle"].button,
  74. #toggle-menu {
  75. line-height: 1.55;
  76. padding: (1.5 * $baseline-unit);
  77. display: inline-block;
  78. text-align: center;
  79. justify-self: end;
  80. font-size: #{map-deep-get($config-global, "font", "size", "xs" )};
  81. }
  82. #toggle-cart[for="woocommerce-toggle"].button svg {
  83. margin-top: -2px;
  84. }
  85. .woocommerce-menu-container,
  86. & > div {
  87. grid-area: dropdown-menu;
  88. margin-top: 2 * $baseline-unit;
  89. position: fixed;
  90. z-index: 100;
  91. top: 0;
  92. bottom: 0;
  93. right: 0;
  94. left: 0;
  95. background: #{map-deep-get($config-global, "color", "background", "default") };
  96. padding: (6 * $baseline-unit) (2 * $baseline-unit) $baseline-unit;
  97. overflow-y: auto;
  98. white-space: normal;
  99. }
  100. }
  101. &.has-marketing-bar {
  102. //Consider marketing bar height
  103. .site-header #site-navigation.main-navigation > div{
  104. top: $wpcom-marketing-bar--height;
  105. }
  106. .site-header #site-navigation.main-navigation {
  107. #woocommerce-toggle:checked + label,
  108. #toggle:checked + label {
  109. top: (2 * $baseline-unit) + $wpcom-marketing-bar--height;
  110. }
  111. }
  112. }
  113. &.admin-bar {
  114. //Consider admin bar height
  115. .site-header #site-navigation.main-navigation > div{
  116. top: $wpadmin-bar--height;
  117. }
  118. .site-header #site-navigation.main-navigation {
  119. #woocommerce-toggle:checked + label,
  120. #toggle:checked + label {
  121. top: (2 * $baseline-unit) + $wpadmin-bar--height + 2;
  122. }
  123. }
  124. }
  125. &.admin-bar.has-marketing-bar {
  126. // Consider admin bar height + marketing bar height
  127. .site-header #site-navigation.main-navigation > div {
  128. top: $wpadmin-bar--height + $wpcom-marketing-bar--height;
  129. }
  130. .site-header #site-navigation.main-navigation {
  131. #woocommerce-toggle:checked + label,
  132. #toggle:checked + label {
  133. top: (2 * $baseline-unit) + $wpadmin-bar--height + $wpcom-marketing-bar--height;
  134. }
  135. }
  136. }
  137. }
  138. // Keep the menu pinned to the top when the menu is open.
  139. .lock-scrolling .site {
  140. left: 0;
  141. max-width: 100%;
  142. position: fixed;
  143. right: 0;
  144. }
  145. }