header.scss 10 KB

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