header.scss 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718
  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. z-index: 2;
  455. }
  456. /* hidden apps menu */
  457. img,
  458. .icon-more-white {
  459. display: inline-block;
  460. width: 20px;
  461. height: 20px;
  462. }
  463. /* App title */
  464. span {
  465. opacity: 0;
  466. position: absolute;
  467. color: var(--color-primary-text);
  468. bottom: 2px;
  469. width: calc(100% - 4px);
  470. text-align: center;
  471. overflow: hidden;
  472. text-overflow: ellipsis;
  473. transition: all var(--animation-quick) ease;
  474. pointer-events: none;
  475. }
  476. /* Set up transitions for showing app titles on hover */
  477. /* App icon */
  478. svg,
  479. .icon-more-white {
  480. transition: transform var(--animation-quick) ease;
  481. }
  482. /* Triangle */
  483. a::before {
  484. transition: border var(--animation-quick) ease;
  485. }
  486. }
  487. .app-loading {
  488. > svg {
  489. display: none;
  490. }
  491. .icon-loading-small-dark {
  492. width: 20px;
  493. height: 20px;
  494. display: block !important;
  495. }
  496. }
  497. /* Show all app titles on hovering app menu area */
  498. &:hover {
  499. li {
  500. /* Move up app icon */
  501. svg,
  502. .icon-more,
  503. .icon-more-white,
  504. .icon-loading-small,
  505. .icon-loading-small-dark {
  506. transform: translateY(-7px);
  507. }
  508. /* Show app title */
  509. span {
  510. opacity: .6;
  511. bottom: 2px;
  512. z-index: -1; /* fix clickability issue - otherwise we need to move the span into the link */
  513. }
  514. /* Prominent app title for current and hovered/focused app */
  515. &:hover span,
  516. &:focus span,
  517. .active + span {
  518. opacity: 1;
  519. }
  520. /* Smaller triangle because of limited space */
  521. a::before {
  522. border-width: 5px;
  523. }
  524. }
  525. }
  526. /* Also show app title on focusing single entry (showing all on focus is only possible with CSS4 and parent selectors) */
  527. li a:focus {
  528. /* Move up app icon */
  529. svg,
  530. .icon-more,
  531. .icon-more-white,
  532. .icon-loading-small,
  533. .icon-loading-small-dark {
  534. transform: translateY(-7px);
  535. }
  536. /* Show app title */
  537. & + span,
  538. span {
  539. opacity: 1;
  540. bottom: 2px;
  541. }
  542. /* Smaller triangle because of limited space */
  543. &::before {
  544. border-width: 5px;
  545. }
  546. }
  547. /* show triangle below active app */
  548. li a::before {
  549. content: ' ';
  550. height: 0;
  551. width: 0;
  552. position: absolute;
  553. pointer-events: none;
  554. border: 0 solid transparent;
  555. border-bottom-color: var(--color-main-background);
  556. border-width: 10px;
  557. transform: translateX(-50%);
  558. left: 50%;
  559. bottom: 0;
  560. display: none;
  561. }
  562. /* triangle focus feedback */
  563. li a.active::before,
  564. li:hover a::before,
  565. li:hover a.active::before,
  566. li a:focus::before {
  567. display: block;
  568. }
  569. li a.active::before {
  570. z-index: 99;
  571. }
  572. li:hover a::before,
  573. li a.active:hover::before,
  574. li a:focus::before {
  575. z-index: 101;
  576. }
  577. li.hidden {
  578. display: none;
  579. }
  580. #more-apps {
  581. z-index: 3;
  582. }
  583. }
  584. /* Skip navigation links – show only on keyboard focus */
  585. .skip-navigation {
  586. padding: 11px;
  587. position: absolute;
  588. overflow: hidden;
  589. z-index: 9999;
  590. top: -999px;
  591. left: 3px;
  592. /* Force primary color, otherwise too light focused color */
  593. background: var(--color-primary) !important;
  594. &.skip-content {
  595. left: $navigation-width;
  596. margin-left: 3px;
  597. }
  598. &:focus,
  599. &:active {
  600. top: $header-height;
  601. }
  602. }
  603. /* SEARCHBOX --------------------------------------------------------------- */
  604. .searchbox {
  605. position: relative;
  606. display: flex;
  607. align-items: center;
  608. input[type='search'] {
  609. position: relative;
  610. font-size: 1.2em;
  611. padding: 3px;
  612. padding-left: 25px;
  613. padding-right: 20px;
  614. background-color: transparent;
  615. color: var(--color-primary-text);
  616. border: 0;
  617. border-radius: var(--border-radius-pill);
  618. height: 34px;
  619. width: 0;
  620. cursor: pointer;
  621. transition: width 100ms, opacity 100ms;
  622. opacity: .6;
  623. &:focus, &:active, &:valid {
  624. background-position-x: 6px;
  625. color: var(--color-primary-text);
  626. width: 155px;
  627. cursor: text;
  628. background-color: var(--color-primary) !important;
  629. border: 1px solid var(--color-primary-text-dark) !important;
  630. }
  631. &:hover, &:focus, &:active {
  632. opacity: 1;
  633. }
  634. & ~ .icon-close-white {
  635. display: inline;
  636. position: absolute;
  637. width: 30px;
  638. height: 100%;
  639. right: 0;
  640. top: 0;
  641. margin: 0;
  642. &, &:focus, &:active, &:hover {
  643. border: none;
  644. background-color: transparent;
  645. }
  646. }
  647. &:not(:valid) ~ .icon-close-white {
  648. display: none;
  649. }
  650. &::-webkit-search-cancel-button {
  651. -webkit-appearance: none;
  652. }
  653. }
  654. }