Ohm-Management - Projektarbeit B-ME
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

navbar.sass 11KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428
  1. $navbar-background-color: $white !default
  2. $navbar-box-shadow-size: 0 2px 0 0 !default
  3. $navbar-box-shadow-color: $background !default
  4. $navbar-height: 3.25rem !default
  5. $navbar-padding-vertical: 1rem !default
  6. $navbar-padding-horizontal: 2rem !default
  7. $navbar-z: 30 !default
  8. $navbar-fixed-z: 30 !default
  9. $navbar-item-color: $grey-dark !default
  10. $navbar-item-hover-color: $link !default
  11. $navbar-item-hover-background-color: $white-bis !default
  12. $navbar-item-active-color: $black !default
  13. $navbar-item-active-background-color: transparent !default
  14. $navbar-item-img-max-height: 1.75rem !default
  15. $navbar-burger-color: $navbar-item-color !default
  16. $navbar-tab-hover-background-color: transparent !default
  17. $navbar-tab-hover-border-bottom-color: $link !default
  18. $navbar-tab-active-color: $link !default
  19. $navbar-tab-active-background-color: transparent !default
  20. $navbar-tab-active-border-bottom-color: $link !default
  21. $navbar-tab-active-border-bottom-style: solid !default
  22. $navbar-tab-active-border-bottom-width: 3px !default
  23. $navbar-dropdown-background-color: $white !default
  24. $navbar-dropdown-border-top: 2px solid $border !default
  25. $navbar-dropdown-offset: -4px !default
  26. $navbar-dropdown-arrow: $link !default
  27. $navbar-dropdown-radius: $radius-large !default
  28. $navbar-dropdown-z: 20 !default
  29. $navbar-dropdown-boxed-radius: $radius-large !default
  30. $navbar-dropdown-boxed-shadow: 0 8px 8px rgba($black, 0.1), 0 0 0 1px rgba($black, 0.1) !default
  31. $navbar-dropdown-item-hover-color: $black !default
  32. $navbar-dropdown-item-hover-background-color: $background !default
  33. $navbar-dropdown-item-active-color: $link !default
  34. $navbar-dropdown-item-active-background-color: $background !default
  35. $navbar-divider-background-color: $background !default
  36. $navbar-divider-height: 2px !default
  37. $navbar-bottom-box-shadow-size: 0 -2px 0 0 !default
  38. $navbar-breakpoint: $desktop !default
  39. =navbar-fixed
  40. left: 0
  41. position: fixed
  42. right: 0
  43. z-index: $navbar-fixed-z
  44. .navbar
  45. background-color: $navbar-background-color
  46. min-height: $navbar-height
  47. position: relative
  48. z-index: $navbar-z
  49. @each $name, $pair in $colors
  50. $color: nth($pair, 1)
  51. $color-invert: nth($pair, 2)
  52. &.is-#{$name}
  53. background-color: $color
  54. color: $color-invert
  55. .navbar-brand
  56. & > .navbar-item,
  57. .navbar-link
  58. color: $color-invert
  59. & > a.navbar-item,
  60. .navbar-link
  61. &:hover,
  62. &.is-active
  63. background-color: darken($color, 5%)
  64. color: $color-invert
  65. .navbar-link
  66. &::after
  67. border-color: $color-invert
  68. .navbar-burger
  69. color: $color-invert
  70. +from($navbar-breakpoint)
  71. .navbar-start,
  72. .navbar-end
  73. & > .navbar-item,
  74. .navbar-link
  75. color: $color-invert
  76. & > a.navbar-item,
  77. .navbar-link
  78. &:hover,
  79. &.is-active
  80. background-color: darken($color, 5%)
  81. color: $color-invert
  82. .navbar-link
  83. &::after
  84. border-color: $color-invert
  85. .navbar-item.has-dropdown:hover .navbar-link,
  86. .navbar-item.has-dropdown.is-active .navbar-link
  87. background-color: darken($color, 5%)
  88. color: $color-invert
  89. .navbar-dropdown
  90. a.navbar-item
  91. &.is-active
  92. background-color: $color
  93. color: $color-invert
  94. & > .container
  95. align-items: stretch
  96. display: flex
  97. min-height: $navbar-height
  98. width: 100%
  99. &.has-shadow
  100. box-shadow: $navbar-box-shadow-size $navbar-box-shadow-color
  101. &.is-fixed-bottom,
  102. &.is-fixed-top
  103. +navbar-fixed
  104. &.is-fixed-bottom
  105. bottom: 0
  106. &.has-shadow
  107. box-shadow: $navbar-bottom-box-shadow-size $navbar-box-shadow-color
  108. &.is-fixed-top
  109. top: 0
  110. html,
  111. body
  112. &.has-navbar-fixed-top
  113. padding-top: $navbar-height
  114. &.has-navbar-fixed-bottom
  115. padding-bottom: $navbar-height
  116. .navbar-brand,
  117. .navbar-tabs
  118. align-items: stretch
  119. display: flex
  120. flex-shrink: 0
  121. min-height: $navbar-height
  122. .navbar-brand
  123. a.navbar-item
  124. &:hover
  125. background-color: transparent
  126. .navbar-tabs
  127. +overflow-touch
  128. max-width: 100vw
  129. overflow-x: auto
  130. overflow-y: hidden
  131. .navbar-burger
  132. color: $navbar-burger-color
  133. +hamburger($navbar-height)
  134. margin-left: auto
  135. .navbar-menu
  136. display: none
  137. .navbar-item,
  138. .navbar-link
  139. color: $navbar-item-color
  140. display: block
  141. line-height: 1.5
  142. padding: 0.5rem 0.75rem
  143. position: relative
  144. .icon
  145. &:only-child
  146. margin-left: -0.25rem
  147. margin-right: -0.25rem
  148. a.navbar-item,
  149. .navbar-link
  150. cursor: pointer
  151. &:hover,
  152. &.is-active
  153. background-color: $navbar-item-hover-background-color
  154. color: $navbar-item-hover-color
  155. .navbar-item
  156. display: block
  157. flex-grow: 0
  158. flex-shrink: 0
  159. img
  160. max-height: $navbar-item-img-max-height
  161. &.has-dropdown
  162. padding: 0
  163. &.is-expanded
  164. flex-grow: 1
  165. flex-shrink: 1
  166. &.is-tab
  167. border-bottom: 1px solid transparent
  168. min-height: $navbar-height
  169. padding-bottom: calc(0.5rem - 1px)
  170. &:hover
  171. background-color: $navbar-tab-hover-background-color
  172. border-bottom-color: $navbar-tab-hover-border-bottom-color
  173. &.is-active
  174. background-color: $navbar-tab-active-background-color
  175. border-bottom-color: $navbar-tab-active-border-bottom-color
  176. border-bottom-style: $navbar-tab-active-border-bottom-style
  177. border-bottom-width: $navbar-tab-active-border-bottom-width
  178. color: $navbar-tab-active-color
  179. padding-bottom: calc(0.5rem - #{$navbar-tab-active-border-bottom-width})
  180. .navbar-content
  181. flex-grow: 1
  182. flex-shrink: 1
  183. .navbar-link:not(.is-arrowless)
  184. padding-right: 2.5em
  185. &::after
  186. @extend %arrow
  187. border-color: $navbar-dropdown-arrow
  188. margin-top: -0.375em
  189. right: 1.125em
  190. .navbar-dropdown
  191. font-size: 0.875rem
  192. padding-bottom: 0.5rem
  193. padding-top: 0.5rem
  194. .navbar-item
  195. padding-left: 1.5rem
  196. padding-right: 1.5rem
  197. .navbar-divider
  198. background-color: $navbar-divider-background-color
  199. border: none
  200. display: none
  201. height: $navbar-divider-height
  202. margin: 0.5rem 0
  203. +until($navbar-breakpoint)
  204. .navbar > .container
  205. display: block
  206. .navbar-brand,
  207. .navbar-tabs
  208. .navbar-item
  209. align-items: center
  210. display: flex
  211. .navbar-link
  212. &::after
  213. display: none
  214. .navbar-menu
  215. background-color: $navbar-background-color
  216. box-shadow: 0 8px 16px rgba($black, 0.1)
  217. padding: 0.5rem 0
  218. &.is-active
  219. display: block
  220. // Fixed navbar
  221. .navbar
  222. &.is-fixed-bottom-touch,
  223. &.is-fixed-top-touch
  224. +navbar-fixed
  225. &.is-fixed-bottom-touch
  226. bottom: 0
  227. &.has-shadow
  228. box-shadow: 0 -2px 3px rgba($black, 0.1)
  229. &.is-fixed-top-touch
  230. top: 0
  231. &.is-fixed-top,
  232. &.is-fixed-top-touch
  233. .navbar-menu
  234. +overflow-touch
  235. max-height: calc(100vh - #{$navbar-height})
  236. overflow: auto
  237. html,
  238. body
  239. &.has-navbar-fixed-top-touch
  240. padding-top: $navbar-height
  241. &.has-navbar-fixed-bottom-touch
  242. padding-bottom: $navbar-height
  243. +from($navbar-breakpoint)
  244. .navbar,
  245. .navbar-menu,
  246. .navbar-start,
  247. .navbar-end
  248. align-items: stretch
  249. display: flex
  250. .navbar
  251. min-height: $navbar-height
  252. &.is-spaced
  253. padding: $navbar-padding-vertical $navbar-padding-horizontal
  254. .navbar-start,
  255. .navbar-end
  256. align-items: center
  257. a.navbar-item,
  258. .navbar-link
  259. border-radius: $radius
  260. &.is-transparent
  261. a.navbar-item,
  262. .navbar-link
  263. &:hover,
  264. &.is-active
  265. background-color: transparent !important
  266. .navbar-item.has-dropdown
  267. &.is-active,
  268. &.is-hoverable:hover
  269. .navbar-link
  270. background-color: transparent !important
  271. .navbar-dropdown
  272. a.navbar-item
  273. &:hover
  274. background-color: $navbar-dropdown-item-hover-background-color
  275. color: $navbar-dropdown-item-hover-color
  276. &.is-active
  277. background-color: $navbar-dropdown-item-active-background-color
  278. color: $navbar-dropdown-item-active-color
  279. .navbar-burger
  280. display: none
  281. .navbar-item,
  282. .navbar-link
  283. align-items: center
  284. display: flex
  285. .navbar-item
  286. display: flex
  287. &.has-dropdown
  288. align-items: stretch
  289. &.has-dropdown-up
  290. .navbar-link::after
  291. transform: rotate(135deg) translate(0.25em, -0.25em)
  292. .navbar-dropdown
  293. border-bottom: $navbar-dropdown-border-top
  294. border-radius: $navbar-dropdown-radius $navbar-dropdown-radius 0 0
  295. border-top: none
  296. bottom: 100%
  297. box-shadow: 0 -8px 8px rgba($black, 0.1)
  298. top: auto
  299. &.is-active,
  300. &.is-hoverable:hover
  301. .navbar-dropdown
  302. display: block
  303. .navbar.is-spaced &,
  304. &.is-boxed
  305. opacity: 1
  306. pointer-events: auto
  307. transform: translateY(0)
  308. .navbar-menu
  309. flex-grow: 1
  310. flex-shrink: 0
  311. .navbar-start
  312. justify-content: flex-start
  313. margin-right: auto
  314. .navbar-end
  315. justify-content: flex-end
  316. margin-left: auto
  317. .navbar-dropdown
  318. background-color: $navbar-dropdown-background-color
  319. border-bottom-left-radius: $navbar-dropdown-radius
  320. border-bottom-right-radius: $navbar-dropdown-radius
  321. border-top: $navbar-dropdown-border-top
  322. box-shadow: 0 8px 8px rgba($black, 0.1)
  323. display: none
  324. font-size: 0.875rem
  325. left: 0
  326. min-width: 100%
  327. position: absolute
  328. top: 100%
  329. z-index: $navbar-dropdown-z
  330. .navbar-item
  331. padding: 0.375rem 1rem
  332. white-space: nowrap
  333. a.navbar-item
  334. padding-right: 3rem
  335. &:hover
  336. background-color: $navbar-dropdown-item-hover-background-color
  337. color: $navbar-dropdown-item-hover-color
  338. &.is-active
  339. background-color: $navbar-dropdown-item-active-background-color
  340. color: $navbar-dropdown-item-active-color
  341. .navbar.is-spaced &,
  342. &.is-boxed
  343. border-radius: $navbar-dropdown-boxed-radius
  344. border-top: none
  345. box-shadow: $navbar-dropdown-boxed-shadow
  346. display: block
  347. opacity: 0
  348. pointer-events: none
  349. top: calc(100% + (#{$navbar-dropdown-offset}))
  350. transform: translateY(-5px)
  351. transition-duration: $speed
  352. transition-property: opacity, transform
  353. &.is-right
  354. left: auto
  355. right: 0
  356. .navbar-divider
  357. display: block
  358. .navbar > .container,
  359. .container > .navbar
  360. .navbar-brand
  361. margin-left: -.75rem
  362. .navbar-menu
  363. margin-right: -.75rem
  364. // Fixed navbar
  365. .navbar
  366. &.is-fixed-bottom-desktop,
  367. &.is-fixed-top-desktop
  368. +navbar-fixed
  369. &.is-fixed-bottom-desktop
  370. bottom: 0
  371. &.has-shadow
  372. box-shadow: 0 -2px 3px rgba($black, 0.1)
  373. &.is-fixed-top-desktop
  374. top: 0
  375. html,
  376. body
  377. &.has-navbar-fixed-top-desktop
  378. padding-top: $navbar-height
  379. &.has-navbar-fixed-bottom-desktop
  380. padding-bottom: $navbar-height
  381. &.has-spaced-navbar-fixed-top
  382. padding-top: $navbar-height + ($navbar-padding-vertical * 2)
  383. &.has-spaced-navbar-fixed-bottom
  384. padding-bottom: $navbar-height + ($navbar-padding-vertical * 2)
  385. // Hover/Active states
  386. a.navbar-item,
  387. .navbar-link
  388. &.is-active
  389. color: $navbar-item-active-color
  390. &.is-active:not(:hover)
  391. background-color: $navbar-item-active-background-color
  392. .navbar-item.has-dropdown
  393. &:hover,
  394. &.is-active
  395. .navbar-link
  396. background-color: $navbar-item-hover-background-color
  397. // Combination
  398. .hero
  399. &.is-fullheight-with-navbar
  400. min-height: calc(100vh - #{$navbar-height})