header.scss 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662
  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. @use 'variables';
  16. /* prevent ugly selection effect on accidental selection */
  17. #header,
  18. #navigation,
  19. #expanddiv {
  20. -webkit-user-select: none;
  21. -moz-user-select: none;
  22. -ms-user-select: none;
  23. a:not(.button):focus-visible, button:not(.button-vue):focus-visible, div[role="button"]:focus-visible {
  24. box-shadow: inset 0 0 0 2px var(--color-primary-text);
  25. border-radius: var(--border-radius);
  26. outline: none;
  27. }
  28. }
  29. /* HEADERS ------------------------------------------------------------------ */
  30. #body-user #header,
  31. #body-settings #header,
  32. #body-public #header {
  33. display: inline-flex;
  34. position: fixed;
  35. top: 0;
  36. width: 100%;
  37. z-index: 2000;
  38. height: variables.$header-height;
  39. background-color: var(--color-primary);
  40. background-image: var(--gradient-primary-background);
  41. box-sizing: border-box;
  42. justify-content: space-between;
  43. }
  44. /* LOGO and APP NAME -------------------------------------------------------- */
  45. #nextcloud {
  46. padding: 5px 0;
  47. padding-left: 86px; // logo width + 2* pa
  48. position: relative;
  49. height: calc(100% - 4px);
  50. box-sizing: border-box;
  51. opacity: 1;
  52. align-items: center;
  53. display: flex;
  54. flex-wrap: wrap;
  55. overflow: hidden;
  56. margin: 2px;
  57. &:hover, &:active {
  58. opacity: 1;
  59. }
  60. }
  61. @mixin header-menu-height() {
  62. min-height: calc(44px * 1.5); // show at least 1.5 entries
  63. max-height: calc(100vh - #{variables.$header-height} * 4);
  64. }
  65. #header {
  66. /* Header menu */
  67. $header-menu-entry-height: 44px;
  68. .header-left > nav > .menu,
  69. .header-right > div > .menu {
  70. background-color: var(--color-main-background);
  71. filter: drop-shadow(0 1px 5px var(--color-box-shadow));
  72. border-radius: 0 0 var(--border-radius) var(--border-radius);
  73. box-sizing: border-box;
  74. z-index: 2000;
  75. position: absolute;
  76. max-width: 350px;
  77. @include header-menu-height();
  78. right: 5px; // relative to parent
  79. top: variables.$header-height;
  80. margin: 0;
  81. &:not(.popovermenu) {
  82. display: none;
  83. }
  84. /* Dropdown arrow */
  85. &:after {
  86. border: 10px solid transparent;
  87. border-bottom-color: var(--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. #apps > ul,
  97. & > div,
  98. & > ul {
  99. overflow-y: auto;
  100. -webkit-overflow-scrolling: touch;
  101. @include header-menu-height();
  102. }
  103. /* Use by the apps menu and the settings right menu */
  104. #apps > ul,
  105. &.settings-menu > ul {
  106. li {
  107. a {
  108. display: inline-flex;
  109. align-items: center;
  110. height: $header-menu-entry-height;
  111. color: var(--color-main-text);
  112. padding: 10px 12px;
  113. box-sizing: border-box;
  114. white-space: nowrap;
  115. position: relative;
  116. width: 100%;
  117. &:hover,
  118. &:focus {
  119. background-color: var(--color-background-hover);
  120. }
  121. &:active,
  122. &.active {
  123. background-color: var(--color-primary-light);
  124. }
  125. &:focus-visible {
  126. box-shadow: inset 0 0 0 2px var(--color-primary);
  127. outline: none;
  128. }
  129. span {
  130. display: inline-block;
  131. padding-bottom: 0;
  132. color: var(--color-main-text);
  133. white-space: nowrap;
  134. overflow: hidden;
  135. text-overflow: ellipsis;
  136. max-width: 110px;
  137. }
  138. .icon-loading-small {
  139. margin-right: 10px;
  140. background-size: 16px 16px;
  141. }
  142. img,
  143. svg {
  144. opacity: .7;
  145. margin-right: 10px;
  146. height: 16px;
  147. width: 16px;
  148. filter: var(--background-invert-if-dark);
  149. }
  150. }
  151. }
  152. }
  153. }
  154. .logo {
  155. display: inline-flex;
  156. background-image: var(--image-logoheader, var(--image-logo, url('../img/logo/logo.svg')));
  157. background-repeat: no-repeat;
  158. background-size: contain;
  159. background-position: center;
  160. width: 62px;
  161. position: absolute;
  162. left: 12px;
  163. top: 1px;
  164. bottom: 1px;
  165. // Invert non-custom logo if primary is too bright
  166. filter: var(--image-logoheader-custom, var(--primary-invert-if-bright))
  167. }
  168. .header-appname-container {
  169. display: none;
  170. padding-right: 10px;
  171. flex-shrink: 0;
  172. }
  173. /* show caret indicator next to logo to make clear it is tappable */
  174. .icon-caret {
  175. display: inline-block;
  176. width: 12px;
  177. height: 12px;
  178. margin: 0;
  179. margin-top: -21px;
  180. padding: 0;
  181. vertical-align: middle;
  182. }
  183. #header-left, .header-left,
  184. #header-right, .header-right {
  185. display: inline-flex;
  186. align-items: center;
  187. }
  188. #header-left, .header-left {
  189. flex: 1 0;
  190. white-space: nowrap;
  191. min-width: 0;
  192. }
  193. #header-right, .header-right {
  194. justify-content: flex-end;
  195. flex-shrink: 1;
  196. }
  197. /* Right header standard */
  198. .header-right {
  199. > div,
  200. > form {
  201. height: 100%;
  202. position: relative;
  203. > .menutoggle {
  204. display: flex;
  205. justify-content: center;
  206. align-items: center;
  207. width: variables.$header-height;
  208. height: 44px;
  209. cursor: pointer;
  210. opacity: 0.85;
  211. padding: 0;
  212. margin: 2px 0;
  213. &:focus {
  214. opacity: 1;
  215. }
  216. &:focus-visible {
  217. outline: none;
  218. }
  219. }
  220. }
  221. }
  222. }
  223. /* hover effect for app switcher label */
  224. .header-appname-container .header-appname {
  225. opacity: .75;
  226. }
  227. .menutoggle {
  228. .icon-caret {
  229. opacity: .75;
  230. }
  231. &:hover {
  232. .header-appname, .icon-caret {
  233. opacity: 1;
  234. }
  235. }
  236. &:focus {
  237. .header-appname, .icon-caret {
  238. opacity: 1;
  239. }
  240. }
  241. &.active {
  242. .header-appname, .icon-caret {
  243. opacity: 1;
  244. }
  245. }
  246. }
  247. /* TODO: move into minimal css file for public shared template */
  248. /* only used for public share pages now as we have the app icons when logged in */
  249. .header-appname {
  250. color: var(--color-primary-text);
  251. font-size: 16px;
  252. font-weight: bold;
  253. margin: 0;
  254. padding: 0;
  255. padding-right: 5px;
  256. overflow: hidden;
  257. text-overflow: ellipsis;
  258. // Take full width to push the header-shared-by bellow (if any)
  259. flex: 1 1 100%;
  260. }
  261. .header-shared-by {
  262. color: var(--color-primary-text);
  263. position: relative;
  264. font-weight: 300;
  265. font-size: 11px;
  266. line-height: 11px;
  267. overflow: hidden;
  268. text-overflow: ellipsis;
  269. }
  270. /* do not show menu toggle on public share links as there is no menu */
  271. #body-public #header .icon-caret {
  272. display: none;
  273. }
  274. /* NAVIGATION --------------------------------------------------------------- */
  275. nav[role='navigation'] {
  276. display: inline-block;
  277. width: variables.$header-height;
  278. height: variables.$header-height;
  279. margin-left: -#{variables.$header-height};
  280. position: relative;
  281. }
  282. #header .header-left > nav > #navigation {
  283. position: relative;
  284. left: 25px; /* half the togglemenu */
  285. transform: translateX(-50%);
  286. width: 160px;
  287. }
  288. #header .header-left > nav > #navigation,
  289. .ui-datepicker,
  290. .ui-timepicker.ui-widget {
  291. background-color: var(--color-main-background);
  292. filter: drop-shadow(0 1px 10px var(--color-box-shadow));
  293. &:after {
  294. /* position of dropdown arrow */
  295. left: 50%;
  296. bottom: 100%;
  297. border: solid transparent;
  298. content: ' ';
  299. height: 0;
  300. width: 0;
  301. position: absolute;
  302. pointer-events: none;
  303. border-color: rgba(0, 0, 0, 0);
  304. border-bottom-color: var(--color-main-background);
  305. border-width: 10px;
  306. margin-left: -10px; /* border width */
  307. }
  308. }
  309. #navigation {
  310. box-sizing: border-box;
  311. .in-header {
  312. display: none;
  313. }
  314. }
  315. /* USER MENU -----------------------------------------------------------------*/
  316. #settings {
  317. display: inline-block;
  318. height: 100%;
  319. cursor: pointer;
  320. flex: 0 0 auto;
  321. /* User menu on the right */
  322. #expand {
  323. opacity: 1; /* override icon opacity */
  324. margin-right: 12px;
  325. &:hover,
  326. &:focus,
  327. &:active {
  328. color: var(--color-primary-text);
  329. #expandDisplayName,
  330. .avatardiv{
  331. border-radius: 50%;
  332. border: 2px solid var(--color-primary-text);
  333. margin: -2px;
  334. }
  335. .avatardiv{
  336. background-color: var(--color-primary-text);
  337. }
  338. #expandDisplayName {
  339. opacity: 1;
  340. }
  341. }
  342. /* Profile picture in header */
  343. .avatardiv {
  344. cursor: pointer;
  345. height: 32px;
  346. width: 32px;
  347. img {
  348. opacity: 1;
  349. cursor: pointer;
  350. }
  351. /* do not show display name when profile picture is present */
  352. &.avatardiv-shown + #expandDisplayName {
  353. display: none;
  354. }
  355. }
  356. #expandDisplayName {
  357. padding: 8px;
  358. opacity: .6;
  359. cursor: pointer;
  360. /* full opacity for gear icon if active */
  361. #body-settings & {
  362. opacity: 1;
  363. }
  364. }
  365. /* show triangle below user menu if active */
  366. #body-settings &:before {
  367. content: ' ';
  368. height: 0;
  369. width: 0;
  370. position: absolute;
  371. pointer-events: none;
  372. border: 0 solid transparent;
  373. border-bottom-color: var(--color-main-background);
  374. border-width: 10px;
  375. bottom: 0;
  376. z-index: 100;
  377. display: block;
  378. }
  379. }
  380. #expanddiv:after {
  381. right: 22px;
  382. }
  383. }
  384. /* Apps menu */
  385. #appmenu {
  386. display: inline-flex;
  387. min-width: variables.$header-height;
  388. z-index: 2;
  389. li {
  390. position: relative;
  391. cursor: pointer;
  392. padding: 0 2px;
  393. display: flex;
  394. justify-content: center;
  395. a {
  396. position: relative;
  397. display: flex;
  398. margin: 0;
  399. height: calc(variables.$header-height - 6px);
  400. width: variables.$header-height;
  401. align-items: center;
  402. justify-content: center;
  403. opacity: .85;
  404. // Make sure most app names don’t ellipsize
  405. letter-spacing: -0.5px;
  406. font-size: 12px;
  407. margin: 2px;
  408. }
  409. /* focused app visual feedback */
  410. &:hover a,
  411. a:focus,
  412. a.active {
  413. opacity: 1;
  414. font-weight: bold;
  415. }
  416. // Text size back to normal for hover/focus
  417. &:hover a,
  418. a:focus {
  419. font-size: 14px;
  420. }
  421. &:hover a + span,
  422. a:focus + span,
  423. &:hover span,
  424. &:focus span,
  425. a:focus span,
  426. a.active span {
  427. display: inline-block;
  428. text-overflow: initial;
  429. width: auto;
  430. overflow: hidden;
  431. padding: 0 5px;
  432. z-index: 2;
  433. }
  434. /* hidden apps menu */
  435. img,
  436. .icon-more-white {
  437. display: inline-block;
  438. width: 20px;
  439. height: 20px;
  440. }
  441. /* App title */
  442. span {
  443. opacity: 0;
  444. position: absolute;
  445. color: var(--color-primary-text);
  446. bottom: 2px;
  447. width: 100%;
  448. text-align: center;
  449. overflow: hidden;
  450. text-overflow: ellipsis;
  451. transition: all var(--animation-quick) ease;
  452. pointer-events: none;
  453. }
  454. /* Set up transitions for showing app titles on hover */
  455. /* App icon */
  456. svg,
  457. .icon-more-white {
  458. transition: transform var(--animation-quick) ease;
  459. // If the primary is too bright, invert the app icons
  460. filter: var(--primary-invert-if-bright);
  461. }
  462. /* Triangle */
  463. a::before {
  464. transition: border var(--animation-quick) ease;
  465. }
  466. }
  467. /* Show all app titles on hovering app menu area */
  468. &:hover {
  469. li {
  470. /* Move up app icon */
  471. svg,
  472. .icon-more,
  473. .icon-more-white,
  474. .icon-loading-small,
  475. .icon-loading-small-dark {
  476. transform: translateY(-7px);
  477. }
  478. /* Show app title */
  479. span {
  480. opacity: 1;
  481. bottom: 2px;
  482. z-index: -1; /* fix clickability issue - otherwise we need to move the span into the link */
  483. }
  484. /* Prominent app title for current and hovered/focused app */
  485. &:hover span,
  486. &:focus span,
  487. .active + span {
  488. opacity: 1;
  489. }
  490. /* Smaller triangle because of limited space */
  491. a::before {
  492. border-width: 5px;
  493. }
  494. }
  495. }
  496. /* Also show app title on focusing single entry (showing all on focus is only possible with CSS4 and parent selectors) */
  497. li a:focus {
  498. /* Move up app icon */
  499. svg,
  500. .icon-more,
  501. .icon-more-white,
  502. .icon-loading-small,
  503. .icon-loading-small-dark {
  504. transform: translateY(-7px);
  505. }
  506. /* Show app title */
  507. & + span,
  508. span {
  509. opacity: 1;
  510. bottom: 2px;
  511. }
  512. /* Smaller triangle because of limited space */
  513. &::before {
  514. border-width: 5px;
  515. }
  516. }
  517. /* show triangle below active app */
  518. li a::before {
  519. content: ' ';
  520. height: 0;
  521. width: 0;
  522. position: absolute;
  523. pointer-events: none;
  524. border: 0 solid transparent;
  525. border-bottom-color: var(--color-main-background);
  526. border-width: 10px;
  527. transform: translateX(-50%);
  528. left: 50%;
  529. bottom: -5px;
  530. display: none;
  531. }
  532. /* triangle focus feedback */
  533. li a.active::before,
  534. li:hover a::before,
  535. li:hover a.active::before,
  536. li a:focus::before {
  537. display: block;
  538. }
  539. li a.active::before {
  540. z-index: 99;
  541. }
  542. li:hover a::before,
  543. li a.active:hover::before,
  544. li a:focus::before {
  545. z-index: 101;
  546. }
  547. li.hidden {
  548. display: none;
  549. }
  550. #more-apps {
  551. z-index: 3;
  552. }
  553. }
  554. .unread-counter {
  555. display: none;
  556. }
  557. #apps .app-icon-notification,
  558. #appmenu .app-icon-notification {
  559. fill: var(--color-error);
  560. }
  561. #apps svg:not(.has-unread),
  562. #appmenu svg:not(.has-unread) {
  563. .app-icon-notification-mask {
  564. display: none;
  565. }
  566. .app-icon-notification {
  567. display: none;
  568. }
  569. }
  570. /* Skip navigation links – show only on keyboard focus */
  571. #skip-actions {
  572. position: absolute;
  573. overflow: hidden;
  574. z-index: 9999;
  575. top: -999px;
  576. left: 3px;
  577. height: 50px;
  578. padding: 11px;
  579. &:focus-within {
  580. top: variables.$header-height;
  581. }
  582. }
  583. /* Empty content messages in the header e.g. notifications, contacts menu, … */
  584. header #emptycontent,
  585. header .emptycontent {
  586. h2 {
  587. font-weight: normal;
  588. font-size: 16px;
  589. }
  590. [class^='icon-'],
  591. [class*='icon-'] {
  592. background-size: 48px;
  593. height: 48px;
  594. width: 48px;
  595. }
  596. }