_navigation.less 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318
  1. // /**
  2. // * Copyright © Magento, Inc. All rights reserved.
  3. // * See COPYING.txt for license details.
  4. // */
  5. //
  6. // Variables
  7. // _____________________________________________
  8. @active-nav-indent: 54px;
  9. //
  10. // Common
  11. // _____________________________________________
  12. & when (@media-common = true) {
  13. .panel.header {
  14. .links,
  15. .switcher {
  16. display: none;
  17. }
  18. }
  19. .nav-sections {
  20. .lib-css(background, @navigation__background);
  21. }
  22. .nav-toggle {
  23. .lib-icon-font(
  24. @icon-menu,
  25. @_icon-font-size: 28px,
  26. @_icon-font-color: @header-icons-color,
  27. @_icon-font-color-hover: @header-icons-color-hover
  28. );
  29. .lib-icon-text-hide();
  30. cursor: pointer;
  31. display: block;
  32. font-size: 0;
  33. left: 15px;
  34. position: absolute;
  35. top: 15px;
  36. z-index: 14;
  37. }
  38. }
  39. //
  40. // Mobile
  41. // _____________________________________________
  42. .media-width(@extremum, @break) when (@extremum = 'max') and (@break = @screen__m) {
  43. .navigation {
  44. padding: 0;
  45. .parent {
  46. .level-top {
  47. position: relative;
  48. .lib-icon-font(
  49. @_icon-font-content: @icon-down,
  50. @_icon-font-size: 42px,
  51. @_icon-font-position: after,
  52. @_icon-font-display: block
  53. );
  54. &:after {
  55. position: absolute;
  56. right: 7px;
  57. top: -8px;
  58. }
  59. &.ui-state-active {
  60. .lib-icon-font-symbol(
  61. @_icon-font-content: @icon-up,
  62. @_icon-font-position: after
  63. );
  64. }
  65. }
  66. }
  67. }
  68. .nav-sections {
  69. -webkit-overflow-scrolling: touch;
  70. .lib-css(transition, left .3s, 1);
  71. height: 100%;
  72. left: -80%;
  73. left: calc(~'-1 * (100% - @{active-nav-indent})');
  74. overflow: auto;
  75. position: fixed;
  76. top: 0;
  77. width: 80%;
  78. width: calc(~'100% - @{active-nav-indent}');
  79. .switcher {
  80. border-top: 1px solid @color-gray82;
  81. font-size: 1.6rem;
  82. font-weight: @font-weight__bold;
  83. margin: 0;
  84. padding: .8rem 3.5rem .8rem 2rem;
  85. .label {
  86. display: block;
  87. margin-bottom: @indent__xs;
  88. }
  89. &:last-child {
  90. border-bottom: 1px solid @color-gray82;
  91. }
  92. }
  93. .switcher-trigger {
  94. strong {
  95. position: relative;
  96. .lib-icon-font(
  97. @_icon-font-content: @icon-down,
  98. @_icon-font-size: 42px,
  99. @_icon-font-position: after,
  100. @_icon-font-display: block
  101. );
  102. &:after {
  103. position: absolute;
  104. right: -40px;
  105. top: -16px;
  106. }
  107. }
  108. &.active strong {
  109. .lib-icon-font-symbol(
  110. @_icon-font-content: @icon-up,
  111. @_icon-font-position: after
  112. );
  113. }
  114. }
  115. .switcher-dropdown {
  116. .lib-list-reset-styles();
  117. display: none;
  118. padding: @indent__s 0;
  119. }
  120. .switcher-options {
  121. &.active {
  122. .switcher-dropdown {
  123. display: block;
  124. }
  125. }
  126. }
  127. .header.links {
  128. .lib-list-reset-styles();
  129. border-bottom: 1px solid @color-gray82;
  130. li {
  131. font-size: 1.6rem;
  132. margin: 0;
  133. &.greet.welcome {
  134. border-top: 1px solid @color-gray82;
  135. font-weight: @font-weight__bold;
  136. padding: .8rem @indent__base;
  137. }
  138. > a {
  139. border-top: 1px solid @color-gray82;
  140. }
  141. }
  142. a,
  143. a:hover {
  144. .lib-css(color, @navigation-level0-item__color);
  145. .lib-css(text-decoration, @navigation-level0-item__text-decoration);
  146. display: block;
  147. font-weight: @font-weight__bold;
  148. padding: .8rem @indent__base;
  149. }
  150. .header.links {
  151. border: 0;
  152. }
  153. }
  154. }
  155. .nav-before-open {
  156. height: 100%;
  157. overflow-x: hidden;
  158. width: 100%;
  159. .page-wrapper {
  160. .lib-css(transition, left .3s, 1);
  161. height: 100%;
  162. left: 0;
  163. overflow: hidden;
  164. position: relative;
  165. }
  166. body {
  167. height: 100%;
  168. overflow: hidden;
  169. position: relative;
  170. width: 100%;
  171. }
  172. }
  173. .nav-open {
  174. .page-wrapper {
  175. left: 80%;
  176. left: calc(~'100% - @{active-nav-indent}');
  177. }
  178. .nav-sections {
  179. @_shadow: 0 0 5px 0 rgba(50, 50, 50, .75);
  180. .lib-css(box-shadow, @_shadow, 1);
  181. left: 0;
  182. z-index: 99;
  183. }
  184. .nav-toggle {
  185. &:after {
  186. background: rgba(0, 0, 0, @overlay__opacity);
  187. content: '';
  188. display: block;
  189. height: 100%;
  190. position: fixed;
  191. right: 0;
  192. top: 0;
  193. width: 100%;
  194. z-index: 1;
  195. }
  196. }
  197. }
  198. .nav-sections-items {
  199. .lib-clearfix();
  200. position: relative;
  201. z-index: 1;
  202. }
  203. .nav-sections-item-title {
  204. background: darken(@navigation__background, 5%);
  205. border: solid darken(@navigation__background, 10%);
  206. border-width: 0 0 1px 1px;
  207. box-sizing: border-box;
  208. float: left;
  209. height: 71px;
  210. padding-top: 24px;
  211. text-align: center;
  212. width: 33.33%;
  213. &.active {
  214. background: transparent;
  215. border-bottom: 0;
  216. }
  217. .nav-sections-item-switch {
  218. &:hover {
  219. text-decoration: none;
  220. }
  221. }
  222. }
  223. .nav-sections-item-content {
  224. .lib-clearfix();
  225. box-sizing: border-box;
  226. float: right;
  227. margin-left: -100%;
  228. margin-top: 71px;
  229. width: 100%;
  230. &.active {
  231. display: block;
  232. }
  233. padding: @indent__m 0;
  234. }
  235. .lib-main-navigation();
  236. }
  237. //
  238. // Desktop
  239. // _____________________________________________
  240. .media-width(@extremum, @break) when (@extremum = 'min') and (@break = @screen__m) {
  241. .nav-toggle {
  242. display: none;
  243. }
  244. .nav-sections {
  245. .lib-vendor-prefix-flex-shrink(0);
  246. .lib-vendor-prefix-flex-basis(auto);
  247. margin-bottom: @indent__m;
  248. }
  249. .nav-sections-item-title {
  250. display: none;
  251. }
  252. .nav-sections-item-content {
  253. display: block !important;
  254. }
  255. .nav-sections-item-content > * {
  256. display: none;
  257. }
  258. .nav-sections-item-content {
  259. > .navigation {
  260. display: block;
  261. }
  262. }
  263. .lib-main-navigation-desktop();
  264. .panel.header {
  265. .links,
  266. .switcher {
  267. display: inline-block;
  268. }
  269. }
  270. }