header.scss 9.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554
  1. /**
  2. * @copyright Copyright (c) 2016, John Molakvoæ <skjnldsv@protonmail.com>
  3. * @copyright Copyright (c) 2016, Julius Haertl <jus@bitgrid.net>
  4. * @copyright Copyright (c) 2016, Lukas Reschke <lukas@statuscode.ch>
  5. * @copyright Copyright (c) 2016, Jos Poortvliet <jos@opensuse.org>
  6. * @copyright Copyright (c) 2016, Erik Pellikka <erik@pellikka.org>
  7. * @copyright Copyright (c) 2016, jowi <sjw@gmx.ch>
  8. * @copyright Copyright (c) 2015, Hendrik Leppelsack <hendrik@leppelsack.de>
  9. * @copyright Copyright (c) 2015, Volker E <volker.e@temporaer.net>
  10. * @copyright Copyright (c) 2014-2017, Jan-Christoph Borchardt <hey@jancborchardt.net>
  11. *
  12. * @license GNU AGPL version 3 or any later version
  13. *
  14. */
  15. /* prevent ugly selection effect on accidental selection */
  16. #header,
  17. #navigation,
  18. #expanddiv {
  19. -webkit-user-select: none;
  20. -moz-user-select: none;
  21. -ms-user-select: none;
  22. }
  23. /* removed until content-focusing issue is fixed */
  24. #skip-to-content a {
  25. position: absolute;
  26. left: -10000px;
  27. top: auto;
  28. width: 1px;
  29. height: 1px;
  30. overflow: hidden;
  31. &:focus {
  32. left: 76px;
  33. top: -9px;
  34. color: $color-primary-text;
  35. width: auto;
  36. height: auto;
  37. }
  38. }
  39. /* HEADERS ------------------------------------------------------------------ */
  40. #body-user #header,
  41. #body-settings #header,
  42. #body-public #header {
  43. display: inline-flex;
  44. position: fixed;
  45. top: 0;
  46. left: 0;
  47. right: 0;
  48. z-index: 2000;
  49. height: 50px;
  50. background-color: $color-primary;
  51. box-sizing: border-box;
  52. justify-content: space-between;
  53. }
  54. /* LOGO and APP NAME -------------------------------------------------------- */
  55. #nextcloud {
  56. padding: 8px 12px;
  57. height: 100%;
  58. box-sizing: border-box;
  59. opacity: 1;
  60. &:focus {
  61. opacity: .75;
  62. }
  63. &:hover, &:active {
  64. opacity: 1;
  65. }
  66. }
  67. #header {
  68. /* Header menu */
  69. .menu {
  70. background-color: $color-main-background;
  71. filter: drop-shadow(0 1px 10px $color-box-shadow);
  72. border-radius: 0 0 3px 3px;
  73. box-sizing: border-box;
  74. z-index: 2000;
  75. position: absolute;
  76. max-width: 350px;
  77. max-height: 280px;
  78. right: 5px;
  79. top: 50px;
  80. margin: 0;
  81. &:not(.popovermenu) {
  82. display: none;
  83. }
  84. /* Dropdown arrow */
  85. &:after {
  86. border: 10px solid transparent;
  87. border-bottom-color: $color-main-background;
  88. bottom: 100%;
  89. content: ' ';
  90. height: 0;
  91. width: 0;
  92. position: absolute;
  93. pointer-events: none;
  94. right: 10px;
  95. }
  96. }
  97. .logo {
  98. display: inline-flex;
  99. background-image: url($image-logo);
  100. background-repeat: no-repeat;
  101. background-size: contain;
  102. background-position: center;
  103. width: 256px;
  104. height: 128px;
  105. margin: 0 auto;
  106. &.logo-icon {
  107. width: 62px;
  108. height: 34px;
  109. img {
  110. opacity: 0;
  111. max-width: 100%;
  112. max-height: 200px;
  113. }
  114. }
  115. }
  116. .header-appname-container {
  117. display: none;
  118. padding-top: 22px;
  119. padding-right: 10px;
  120. flex-shrink: 0;
  121. }
  122. /* show caret indicator next to logo to make clear it is tappable */
  123. .icon-caret {
  124. display: inline-block;
  125. width: 12px;
  126. height: 12px;
  127. margin: 0;
  128. margin-top: -21px;
  129. padding: 0;
  130. vertical-align: middle;
  131. }
  132. #header-left, .header-left,
  133. #header-right, .header-right {
  134. display: inline-flex;
  135. align-items: center;
  136. }
  137. #header-left, .header-left {
  138. flex: 0 0;
  139. flex-grow: 1;
  140. white-space: nowrap;
  141. }
  142. #header-right, .header-right {
  143. justify-content: flex-end;
  144. }
  145. /* Right header standard */
  146. .header-right {
  147. > div,
  148. > form {
  149. height: 100%;
  150. position: relative;
  151. > .menutoggle {
  152. display: flex;
  153. justify-content: center;
  154. align-items: center;
  155. width: 50px;
  156. height: 100%;
  157. cursor: pointer;
  158. opacity: 0.6;
  159. padding: 0;
  160. margin: 0;
  161. }
  162. }
  163. }
  164. }
  165. /* hover effect for app switcher label */
  166. .header-appname-container .header-appname {
  167. opacity: .75;
  168. }
  169. .menutoggle {
  170. .icon-caret {
  171. opacity: .75;
  172. }
  173. &:hover {
  174. .header-appname, .icon-caret {
  175. opacity: 1;
  176. }
  177. }
  178. &:focus {
  179. .header-appname, .icon-caret {
  180. opacity: 1;
  181. }
  182. }
  183. &.active {
  184. .header-appname, .icon-caret {
  185. opacity: 1;
  186. }
  187. }
  188. }
  189. /* show appname next to logo */
  190. .header-appname {
  191. display: inline-block;
  192. position: relative;
  193. color: $color-primary-text;
  194. font-size: 16px;
  195. font-weight: 300;
  196. margin: 0;
  197. margin-top: -26px;
  198. padding: 7px 0 7px 5px;
  199. vertical-align: middle;
  200. }
  201. /* do not show menu toggle on public share links as there is no menu */
  202. #body-public #header .icon-caret {
  203. display: none;
  204. }
  205. /* NAVIGATION --------------------------------------------------------------- */
  206. nav[role='navigation'] {
  207. display: inline-block;
  208. width: 50px;
  209. height: 50px;
  210. margin-left: -50px;
  211. }
  212. .header-left #navigation {
  213. position: relative;
  214. left: 25px; /* half the togglemenu */
  215. transform: translateX(-50%);
  216. width: 160px;
  217. }
  218. .header-left #navigation,
  219. .ui-datepicker,
  220. .ui-timepicker.ui-widget {
  221. background-color: $color-main-background;
  222. filter: drop-shadow(0 1px 10px $color-box-shadow);
  223. &:after {
  224. /* position of dropdown arrow */
  225. left: 50%;
  226. bottom: 100%;
  227. border: solid transparent;
  228. content: ' ';
  229. height: 0;
  230. width: 0;
  231. position: absolute;
  232. pointer-events: none;
  233. border-color: rgba(0, 0, 0, 0);
  234. border-bottom-color: $color-main-background;
  235. border-width: 10px;
  236. margin-left: -10px; /* border width */
  237. }
  238. }
  239. #navigation {
  240. box-sizing: border-box;
  241. * {
  242. box-sizing: border-box;
  243. }
  244. li {
  245. display: inline-block;
  246. }
  247. a {
  248. position: relative;
  249. display: inline-flex;
  250. padding: 10px 12px;
  251. height: 40px;
  252. align-items: center;
  253. span {
  254. display: inline-block;
  255. padding-bottom: 0;
  256. padding-left: 10px;
  257. color: $color-main-text;
  258. white-space: nowrap;
  259. overflow: hidden;
  260. text-overflow: ellipsis;
  261. max-width: 110px;
  262. }
  263. svg,
  264. span {
  265. opacity: .7;
  266. }
  267. &:hover svg,
  268. &:focus svg,
  269. &:hover span,
  270. &:focus span {
  271. opacity: 1;
  272. }
  273. &.active {
  274. svg, span {
  275. opacity: 1;
  276. }
  277. }
  278. }
  279. .app-icon {
  280. margin: 0 auto;
  281. padding: 0;
  282. max-height: 32px;
  283. max-width: 32px;
  284. }
  285. /* loading feedback for apps */
  286. .app-loading {
  287. .icon-loading-small {
  288. display: inline !important;
  289. position: absolute;
  290. left: 12px;
  291. width: 16px;
  292. height: 16px;
  293. }
  294. .app-icon {
  295. opacity: 0;
  296. }
  297. }
  298. }
  299. /* Apps management */
  300. #apps {
  301. max-height: calc(100vh - 100px);
  302. overflow: auto;
  303. .in-header {
  304. display: none;
  305. }
  306. ul {
  307. display: flex;
  308. flex-direction: column;
  309. }
  310. }
  311. /* USER MENU -----------------------------------------------------------------*/
  312. #settings {
  313. display: inline-block;
  314. height: 100%;
  315. color: rgba($color-primary-text, 0.7);
  316. cursor: pointer;
  317. flex: 0 0 auto;
  318. /* User menu on the right */
  319. #expand {
  320. opacity: 1; /* override icon opacity */
  321. padding-right: 12px;
  322. img {
  323. opacity: .7;
  324. margin-bottom: -2px;
  325. }
  326. &:hover,
  327. &:focus,
  328. &:active {
  329. color: $color-primary-text;
  330. img, #expandDisplayName {
  331. opacity: 1;
  332. }
  333. }
  334. /* Profile picture in header */
  335. .avatardiv {
  336. cursor: pointer;
  337. height: 32px;
  338. width: 32px;
  339. img {
  340. opacity: 1;
  341. cursor: pointer;
  342. }
  343. /* do not show display name when profile picture is present */
  344. &.avatardiv-shown + #expandDisplayName {
  345. display: none;
  346. }
  347. }
  348. #expandDisplayName {
  349. padding: 8px;
  350. opacity: .6;
  351. /* full opacity for gear icon if active */
  352. #body-settings & {
  353. opacity: 1;
  354. }
  355. }
  356. /* show triangle below user menu if active */
  357. #body-settings &:before {
  358. content: ' ';
  359. height: 0;
  360. width: 0;
  361. position: absolute;
  362. pointer-events: none;
  363. border: 0 solid transparent;
  364. border-bottom-color: $color-main-background;
  365. border-width: 10px;
  366. bottom: 0;
  367. z-index: 100;
  368. display: block;
  369. }
  370. }
  371. }
  372. #expanddiv {
  373. &.menu {
  374. right: 17px;
  375. }
  376. a {
  377. display: inline-flex;
  378. align-items: center;
  379. height: 40px;
  380. color: $color-main-text;
  381. padding: 12px;
  382. box-sizing: border-box;
  383. opacity: .7;
  384. white-space: nowrap;
  385. .icon-loading-small {
  386. margin-right: 9px;
  387. background-size: 16px 16px;
  388. }
  389. img {
  390. margin-right: 9px;
  391. height: 16px;
  392. width: 16px;
  393. }
  394. &:hover,
  395. &:focus,
  396. &:active,
  397. &.active {
  398. opacity: 1;
  399. box-shadow: inset 4px 0 $color-primary;
  400. }
  401. }
  402. }
  403. #appmenu {
  404. display: inline-block;
  405. width: auto;
  406. min-width: 50px;
  407. height: 100%;
  408. clear: both;
  409. li {
  410. float: left;
  411. display: inline-block;
  412. position: relative;
  413. vertical-align: top !important;
  414. height: 100%;
  415. cursor: pointer;
  416. a {
  417. position: relative;
  418. display: inline-block;
  419. margin: 0;
  420. padding: 15px 15px;
  421. height: 20px;
  422. text-align: center;
  423. vertical-align: top !important;
  424. opacity: .6;
  425. }
  426. }
  427. .app-loading {
  428. > svg {
  429. display: none;
  430. }
  431. .icon-loading-small-dark {
  432. width: 20px;
  433. height: 20px;
  434. display: block !important;
  435. }
  436. }
  437. li:hover a,
  438. li a:focus,
  439. li a.active {
  440. opacity: 1;
  441. }
  442. li img,
  443. .icon-more-white {
  444. display: inline-block;
  445. width: 20px;
  446. height: 20px;
  447. }
  448. li span {
  449. display: none;
  450. position: absolute;
  451. overflow: visible;
  452. background-color: $color-main-background;
  453. white-space: nowrap;
  454. border: none;
  455. border-radius: $border-radius;
  456. border-top-left-radius: 0;
  457. border-top-right-radius: 0;
  458. color: rgba($color-main-text, .7);
  459. width: auto;
  460. left: 50%;
  461. top: 100%;
  462. transform: translateX(-50%);
  463. padding: 4px 10px;
  464. filter: drop-shadow(0 1px 10px $color-box-shadow);
  465. z-index: 100;
  466. }
  467. li:hover span {
  468. display: inline-block;
  469. }
  470. /* show triangle below active app */
  471. li:hover a:before,
  472. li a.active:before {
  473. content: ' ';
  474. height: 0;
  475. width: 0;
  476. position: absolute;
  477. pointer-events: none;
  478. border: 0 solid transparent;
  479. border-bottom-color: $color-main-background;
  480. border-width: 10px;
  481. transform: translateX(-50%);
  482. left: 50%;
  483. bottom: 0;
  484. display: none;
  485. }
  486. li a.active:before,
  487. li:hover a:before,
  488. li:hover a.active:before {
  489. display: block;
  490. }
  491. li a.active:before {
  492. z-index: 99;
  493. }
  494. li:hover a:before,
  495. li a.active:hover:before {
  496. z-index: 101;
  497. }
  498. &.menu-open li:hover a:before,
  499. &.menu-open li a.active:before,
  500. &.menu-open li:hover span {
  501. display: none !important;
  502. }
  503. li.hidden {
  504. display: none;
  505. }
  506. }