header.scss 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721
  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: var(--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. width: 100%;
  47. z-index: 2000;
  48. height: $header-height;
  49. background-color: var(--color-primary);
  50. box-sizing: border-box;
  51. justify-content: space-between;
  52. }
  53. /* LOGO and APP NAME -------------------------------------------------------- */
  54. #nextcloud {
  55. padding: 7px 0;
  56. padding-left: 86px; // logo width + 2* pa
  57. position: relative;
  58. height: 100%;
  59. box-sizing: border-box;
  60. opacity: 1;
  61. display: flex;
  62. align-items: center;
  63. flex-wrap: wrap;
  64. overflow: hidden;
  65. &:focus {
  66. opacity: .75;
  67. }
  68. &:hover, &:active {
  69. opacity: 1;
  70. }
  71. }
  72. #header {
  73. /* Header menu */
  74. .header-left > nav > .menu,
  75. .header-right > div > .menu {
  76. background-color: var(--color-main-background);
  77. filter: drop-shadow(0 1px 5px var(--color-box-shadow));
  78. border-radius: 0 0 var(--border-radius) var(--border-radius);
  79. box-sizing: border-box;
  80. z-index: 2000;
  81. position: absolute;
  82. max-width: 350px;
  83. max-height: 280px;
  84. right: 5px;
  85. top: $header-height;
  86. margin: 0;
  87. &:not(.popovermenu) {
  88. display: none;
  89. }
  90. /* Dropdown arrow */
  91. &:after {
  92. border: 10px solid transparent;
  93. border-bottom-color: var(--color-main-background);
  94. bottom: 100%;
  95. content: ' ';
  96. height: 0;
  97. width: 0;
  98. position: absolute;
  99. pointer-events: none;
  100. right: 10px;
  101. }
  102. }
  103. .logo {
  104. display: inline-flex;
  105. background-image: var(--image-logo);
  106. background-repeat: no-repeat;
  107. background-size: contain;
  108. background-position: center;
  109. width: 62px;
  110. position: absolute;
  111. left: 12px;
  112. top: 1px;
  113. bottom: 1px;
  114. img {
  115. opacity: 0;
  116. max-width: 100%;
  117. max-height: 200px;
  118. }
  119. }
  120. .header-appname-container {
  121. display: none;
  122. padding-right: 10px;
  123. flex-shrink: 0;
  124. }
  125. /* show caret indicator next to logo to make clear it is tappable */
  126. .icon-caret {
  127. display: inline-block;
  128. width: 12px;
  129. height: 12px;
  130. margin: 0;
  131. margin-top: -21px;
  132. padding: 0;
  133. vertical-align: middle;
  134. }
  135. #header-left, .header-left,
  136. #header-right, .header-right {
  137. display: inline-flex;
  138. align-items: center;
  139. }
  140. #header-left, .header-left {
  141. flex: 0 0;
  142. flex-grow: 1;
  143. white-space: nowrap;
  144. }
  145. #header-right, .header-right {
  146. justify-content: flex-end;
  147. flex-shrink: 1;
  148. }
  149. /* Right header standard */
  150. .header-right {
  151. > div,
  152. > form {
  153. height: 100%;
  154. position: relative;
  155. > .menutoggle {
  156. display: flex;
  157. justify-content: center;
  158. align-items: center;
  159. width: $header-height;
  160. height: 100%;
  161. cursor: pointer;
  162. opacity: 0.6;
  163. padding: 0;
  164. margin: 0;
  165. }
  166. }
  167. }
  168. }
  169. /* hover effect for app switcher label */
  170. .header-appname-container .header-appname {
  171. opacity: .75;
  172. }
  173. .menutoggle {
  174. .icon-caret {
  175. opacity: .75;
  176. }
  177. &:hover {
  178. .header-appname, .icon-caret {
  179. opacity: 1;
  180. }
  181. }
  182. &:focus {
  183. .header-appname, .icon-caret {
  184. opacity: 1;
  185. }
  186. }
  187. &.active {
  188. .header-appname, .icon-caret {
  189. opacity: 1;
  190. }
  191. }
  192. }
  193. /* only used for public share pages now as we have the app icons when logged in */
  194. .header-appname {
  195. color: var(--color-primary-text);
  196. font-size: 16px;
  197. font-weight: bold;
  198. margin: 0;
  199. padding: 0;
  200. padding-right: 5px;
  201. overflow: hidden;
  202. text-overflow: ellipsis;
  203. }
  204. /* do not show menu toggle on public share links as there is no menu */
  205. #body-public #header .icon-caret {
  206. display: none;
  207. }
  208. /* NAVIGATION --------------------------------------------------------------- */
  209. nav[role='navigation'] {
  210. display: inline-block;
  211. width: $header-height;
  212. height: $header-height;
  213. margin-left: -$header-height;
  214. position: relative;
  215. }
  216. #header .header-left > nav > #navigation {
  217. position: relative;
  218. left: 25px; /* half the togglemenu */
  219. transform: translateX(-50%);
  220. width: 160px;
  221. }
  222. #header .header-left > nav > #navigation,
  223. .ui-datepicker,
  224. .ui-timepicker.ui-widget {
  225. background-color: var(--color-main-background);
  226. filter: drop-shadow(0 1px 10px var(--color-box-shadow));
  227. &:after {
  228. /* position of dropdown arrow */
  229. left: 50%;
  230. bottom: 100%;
  231. border: solid transparent;
  232. content: ' ';
  233. height: 0;
  234. width: 0;
  235. position: absolute;
  236. pointer-events: none;
  237. border-color: rgba(0, 0, 0, 0);
  238. border-bottom-color: var(--color-main-background);
  239. border-width: 10px;
  240. margin-left: -10px; /* border width */
  241. }
  242. }
  243. #navigation {
  244. box-sizing: border-box;
  245. * {
  246. box-sizing: border-box;
  247. }
  248. li {
  249. display: inline-block;
  250. }
  251. a {
  252. position: relative;
  253. width: 100%;
  254. display: inline-flex;
  255. padding: 10px 12px;
  256. height: 40px;
  257. align-items: center;
  258. span {
  259. display: inline-block;
  260. padding-bottom: 0;
  261. padding-left: 10px;
  262. color: var(--color-main-text);
  263. white-space: nowrap;
  264. overflow: hidden;
  265. text-overflow: ellipsis;
  266. max-width: 110px;
  267. }
  268. svg,
  269. span {
  270. opacity: .7;
  271. }
  272. &:hover svg,
  273. &:focus svg,
  274. &:hover span,
  275. &:focus span {
  276. opacity: 1;
  277. }
  278. &.active {
  279. svg, span {
  280. opacity: 1;
  281. }
  282. }
  283. }
  284. .app-icon {
  285. margin: 0 auto;
  286. padding: 0;
  287. max-height: 32px;
  288. max-width: 32px;
  289. }
  290. /* loading feedback for apps */
  291. .app-loading {
  292. .icon-loading-small {
  293. display: inline !important;
  294. position: absolute;
  295. left: 12px;
  296. width: 16px;
  297. height: 16px;
  298. }
  299. .app-icon {
  300. opacity: 0;
  301. }
  302. }
  303. }
  304. /* Apps management */
  305. #apps {
  306. max-height: inherit;
  307. overflow-x: hidden;
  308. overflow-y: auto;
  309. -webkit-overflow-scrolling: touch;
  310. .in-header {
  311. display: none;
  312. }
  313. ul {
  314. display: flex;
  315. flex-direction: column;
  316. }
  317. }
  318. /* USER MENU -----------------------------------------------------------------*/
  319. #settings {
  320. display: inline-block;
  321. height: 100%;
  322. cursor: pointer;
  323. flex: 0 0 auto;
  324. /* User menu on the right */
  325. #expand {
  326. opacity: 1; /* override icon opacity */
  327. padding-right: 12px;
  328. &:hover,
  329. &:focus,
  330. &:active {
  331. color: var(--color-primary-text);
  332. #expandDisplayName,
  333. .avatardiv{
  334. border-radius: 50%;
  335. border: 2px solid var(--color-primary-text);
  336. margin: -2px;
  337. }
  338. .avatardiv{
  339. background-color: var(--color-primary-text);
  340. }
  341. #expandDisplayName {
  342. opacity: 1;
  343. }
  344. }
  345. /* Profile picture in header */
  346. .avatardiv {
  347. cursor: pointer;
  348. height: 32px;
  349. width: 32px;
  350. img {
  351. opacity: 1;
  352. cursor: pointer;
  353. }
  354. /* do not show display name when profile picture is present */
  355. &.avatardiv-shown + #expandDisplayName {
  356. display: none;
  357. }
  358. }
  359. #expandDisplayName {
  360. padding: 8px;
  361. opacity: .6;
  362. cursor: pointer;
  363. /* full opacity for gear icon if active */
  364. #body-settings & {
  365. opacity: 1;
  366. }
  367. }
  368. /* show triangle below user menu if active */
  369. #body-settings &:before {
  370. content: ' ';
  371. height: 0;
  372. width: 0;
  373. position: absolute;
  374. pointer-events: none;
  375. border: 0 solid transparent;
  376. border-bottom-color: var(--color-main-background);
  377. border-width: 10px;
  378. bottom: 0;
  379. z-index: 100;
  380. display: block;
  381. }
  382. }
  383. #expanddiv:after {
  384. right: 22px;
  385. }
  386. }
  387. /* Settings menu */
  388. #expanddiv {
  389. a {
  390. display: inline-flex;
  391. align-items: center;
  392. height: 40px;
  393. color: var(--color-main-text);
  394. padding: 12px;
  395. box-sizing: border-box;
  396. opacity: .7;
  397. white-space: nowrap;
  398. .icon-loading-small {
  399. margin-right: 9px;
  400. background-size: 16px 16px;
  401. }
  402. img {
  403. margin-right: 9px;
  404. height: 16px;
  405. width: 16px;
  406. }
  407. &:hover,
  408. &:focus,
  409. &:active,
  410. &.active {
  411. opacity: 1;
  412. box-shadow: inset 4px 0 var(--color-primary);
  413. }
  414. }
  415. }
  416. /* Apps menu */
  417. #appmenu {
  418. display: inline-flex;
  419. min-width: $header-height;
  420. z-index: 2;
  421. li {
  422. position: relative;
  423. cursor: pointer;
  424. margin: 0 2px;
  425. display: flex;
  426. justify-content: center;
  427. a {
  428. position: relative;
  429. display: flex;
  430. margin: 0;
  431. height: $header-height;
  432. width: $header-height;
  433. align-items: center;
  434. justify-content: center;
  435. opacity: .6;
  436. }
  437. /* focused app visual feedback */
  438. &:hover a,
  439. a:focus,
  440. a.active {
  441. opacity: 1;
  442. }
  443. &:hover a + span,
  444. a:focus + span,
  445. &:hover span,
  446. &:focus span,
  447. a:focus span {
  448. display: inline-block;
  449. text-overflow: initial;
  450. width: auto;
  451. overflow: hidden;
  452. background-color: var(--color-primary-element);
  453. padding: 0 5px;
  454. }
  455. /* hidden apps menu */
  456. img,
  457. .icon-more-white {
  458. display: inline-block;
  459. width: 20px;
  460. height: 20px;
  461. }
  462. /* App title */
  463. span {
  464. opacity: 0;
  465. position: absolute;
  466. color: var(--color-primary-text);
  467. bottom: -5px;
  468. width: calc(100% - 4px);
  469. text-align: center;
  470. overflow: hidden;
  471. text-overflow: ellipsis;
  472. transition: all var(--animation-quick) ease;
  473. }
  474. /* Set up transitions for showing app titles on hover */
  475. /* App icon */
  476. svg,
  477. .icon-more-white {
  478. transition: transform var(--animation-quick) ease;
  479. }
  480. /* Triangle */
  481. a::before {
  482. transition: border var(--animation-quick) ease;
  483. }
  484. }
  485. .app-loading {
  486. > svg {
  487. display: none;
  488. }
  489. .icon-loading-small-dark {
  490. width: 20px;
  491. height: 20px;
  492. display: block !important;
  493. }
  494. }
  495. /* Show all app titles on hovering app menu area */
  496. &:hover {
  497. li {
  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. opacity: .6;
  509. bottom: 2px;
  510. z-index: -1; /* fix clickability issue - otherwise we need to move the span into the link */
  511. }
  512. /* Prominent app title for current and hovered/focused app */
  513. &:hover span,
  514. &:focus span,
  515. .active + span {
  516. opacity: 1;
  517. }
  518. /* Smaller triangle because of limited space */
  519. a::before {
  520. border-width: 5px;
  521. }
  522. }
  523. }
  524. /* Also show app title on focusing single entry (showing all on focus is only possible with CSS4 and parent selectors) */
  525. li a:focus {
  526. /* Move up app icon */
  527. svg,
  528. .icon-more,
  529. .icon-more-white,
  530. .icon-loading-small,
  531. .icon-loading-small-dark {
  532. transform: translateY(-7px);
  533. }
  534. /* Show app title */
  535. & + span,
  536. span {
  537. opacity: 1;
  538. bottom: 2px;
  539. }
  540. /* Smaller triangle because of limited space */
  541. &::before {
  542. border-width: 5px;
  543. }
  544. }
  545. /* show triangle below active app */
  546. li a::before {
  547. content: ' ';
  548. height: 0;
  549. width: 0;
  550. position: absolute;
  551. pointer-events: none;
  552. border: 0 solid transparent;
  553. border-bottom-color: var(--color-main-background);
  554. border-width: 10px;
  555. transform: translateX(-50%);
  556. left: 50%;
  557. bottom: 0;
  558. display: none;
  559. }
  560. /* triangle focus feedback */
  561. li a.active::before,
  562. li:hover a::before,
  563. li:hover a.active::before,
  564. li a:focus::before {
  565. display: block;
  566. }
  567. li a.active::before {
  568. z-index: 99;
  569. }
  570. li:hover a::before,
  571. li a.active:hover::before,
  572. li a:focus::before {
  573. z-index: 101;
  574. }
  575. &.menu-open li:hover a::before,
  576. &.menu-open li a.active::before,
  577. &.menu-open li:hover span {
  578. display: none !important;
  579. }
  580. li.hidden {
  581. display: none;
  582. }
  583. #more-apps {
  584. z-index: 3;
  585. }
  586. }
  587. /* Skip navigation links – show only on keyboard focus */
  588. .skip-navigation {
  589. padding: 11px;
  590. position: absolute;
  591. overflow: hidden;
  592. z-index: 9999;
  593. top: -999px;
  594. left: 3px;
  595. /* Force primary color, otherwise too light focused color */
  596. background: var(--color-primary) !important;
  597. &.skip-content {
  598. left: $navigation-width;
  599. margin-left: 3px;
  600. }
  601. &:focus,
  602. &:active {
  603. top: $header-height;
  604. }
  605. }
  606. /* SEARCHBOX --------------------------------------------------------------- */
  607. .searchbox {
  608. position: relative;
  609. display: flex;
  610. align-items: center;
  611. input[type='search'] {
  612. position: relative;
  613. font-size: 1.2em;
  614. padding: 3px;
  615. padding-left: 25px;
  616. padding-right: 20px;
  617. background-color: transparent;
  618. color: var(--color-primary-text);
  619. border: 0;
  620. border-radius: var(--border-radius-pill);
  621. height: 34px;
  622. width: 0;
  623. cursor: pointer;
  624. transition: width 100ms, opacity 100ms;
  625. opacity: .6;
  626. &:focus, &:active, &:valid {
  627. background-position-x: 6px;
  628. color: var(--color-primary-text);
  629. width: 155px;
  630. cursor: text;
  631. background-color: var(--color-primary) !important;
  632. border: 1px solid var(--color-primary-text-dark) !important;
  633. }
  634. &:hover, &:focus, &:active {
  635. opacity: 1;
  636. }
  637. & ~ .icon-close-white {
  638. display: inline;
  639. position: absolute;
  640. width: 30px;
  641. height: 100%;
  642. right: 0;
  643. top: 0;
  644. margin: 0;
  645. &, &:focus, &:active, &:hover {
  646. border: none;
  647. background-color: transparent;
  648. }
  649. }
  650. &:not(:valid) ~ .icon-close-white {
  651. display: none;
  652. }
  653. &::-webkit-search-cancel-button {
  654. -webkit-appearance: none;
  655. }
  656. }
  657. }