header.scss 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552
  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. background-image: url('#{$image-logo}');
  97. background-repeat: no-repeat;
  98. background-size: 175px;
  99. background-position: center;
  100. width: 252px;
  101. height: 120px;
  102. margin: 0 auto;
  103. img {
  104. opacity: 0;
  105. max-width: 100%;
  106. max-height: 200px;
  107. }
  108. }
  109. .logo-icon {
  110. /* display logo so appname can be shown next to it */
  111. display: inline-block;
  112. background-image: url($image-logo);
  113. background-repeat: no-repeat;
  114. background-position: center center;
  115. background-size: contain;
  116. width: 62px;
  117. height: 34px;
  118. }
  119. .header-appname-container {
  120. display: none;
  121. padding-top: 22px;
  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. }
  144. #header-right, .header-right {
  145. justify-content: flex-end;
  146. }
  147. }
  148. /* hover effect for app switcher label */
  149. .header-appname-container .header-appname {
  150. -ms-filter: 'progid:DXImageTransform.Microsoft.Alpha(Opacity=75)';
  151. opacity: .75;
  152. }
  153. .menutoggle {
  154. .icon-caret {
  155. -ms-filter: 'progid:DXImageTransform.Microsoft.Alpha(Opacity=75)';
  156. opacity: .75;
  157. }
  158. &:hover {
  159. .header-appname, .icon-caret {
  160. -ms-filter: 'progid:DXImageTransform.Microsoft.Alpha(Opacity=100)';
  161. opacity: 1;
  162. }
  163. }
  164. &:focus {
  165. .header-appname, .icon-caret {
  166. -ms-filter: 'progid:DXImageTransform.Microsoft.Alpha(Opacity=100)';
  167. opacity: 1;
  168. }
  169. }
  170. &.active {
  171. .header-appname, .icon-caret {
  172. -ms-filter: 'progid:DXImageTransform.Microsoft.Alpha(Opacity=100)';
  173. opacity: 1;
  174. }
  175. }
  176. }
  177. /* show appname next to logo */
  178. .header-appname {
  179. display: inline-block;
  180. position: relative;
  181. color: $color-primary-text;
  182. font-size: 16px;
  183. font-weight: 300;
  184. margin: 0;
  185. margin-top: -26px;
  186. padding: 7px 0 7px 5px;
  187. vertical-align: middle;
  188. }
  189. /* do not show menu toggle on public share links as there is no menu */
  190. #body-public #header .icon-caret {
  191. display: none;
  192. }
  193. /* NAVIGATION --------------------------------------------------------------- */
  194. nav {
  195. display: inline-block;
  196. width: 44px;
  197. height: 44px;
  198. margin-left: -54px;
  199. }
  200. #navigation {
  201. position: relative;
  202. left: -100%;
  203. width: 160px;
  204. background-color: $color-main-background;
  205. box-shadow: 0 1px 10px $color-box-shadow;
  206. &:after {
  207. /* position of dropdown arrow */
  208. left: 47%;
  209. bottom: 100%;
  210. border: solid transparent;
  211. content: ' ';
  212. height: 0;
  213. width: 0;
  214. position: absolute;
  215. pointer-events: none;
  216. border-color: rgba(0, 0, 0, 0);
  217. border-bottom-color: rgba(255, 255, 255, .97);
  218. border-width: 9px;
  219. margin-left: -9px;
  220. }
  221. }
  222. /* arrow look */
  223. #expanddiv:after {
  224. bottom: 100%;
  225. border: solid transparent;
  226. content: ' ';
  227. height: 0;
  228. width: 0;
  229. position: absolute;
  230. pointer-events: none;
  231. border-color: rgba(0, 0, 0, 0);
  232. border-bottom-color: rgba(255, 255, 255, .97);
  233. border-width: 10px;
  234. margin-left: -10px;
  235. }
  236. #navigation {
  237. box-sizing: border-box;
  238. * {
  239. box-sizing: border-box;
  240. }
  241. li {
  242. display: inline-block;
  243. }
  244. a {
  245. position: relative;
  246. display: block;
  247. padding: 10px 12px;
  248. height:40px;
  249. vertical-align: text-bottom;
  250. span {
  251. display: inline-block;
  252. padding-bottom: 0;
  253. padding-left: 10px;
  254. color: $color-main-text;
  255. white-space: nowrap;
  256. overflow: hidden;
  257. text-overflow: ellipsis;
  258. max-width: 110px;
  259. }
  260. svg,
  261. span {
  262. -ms-filter: 'progid:DXImageTransform.Microsoft.Alpha(Opacity=70)';
  263. opacity: .7;
  264. }
  265. svg {
  266. margin-bottom: 2px;
  267. }
  268. &:hover svg,
  269. &:focus svg,
  270. &:hover span,
  271. &:focus span {
  272. -ms-filter: 'progid:DXImageTransform.Microsoft.Alpha(Opacity=100)';
  273. opacity: 1;
  274. }
  275. &.active {
  276. svg, span {
  277. -ms-filter: 'progid:DXImageTransform.Microsoft.Alpha(Opacity=100)';
  278. opacity: 1;
  279. }
  280. }
  281. }
  282. .app-icon {
  283. margin: 0 auto;
  284. padding: 0;
  285. max-height: 32px;
  286. max-width: 32px;
  287. }
  288. }
  289. /* loading feedback for apps */
  290. .app-loading {
  291. .icon-loading-small-dark {
  292. display: inline !important;
  293. position: absolute;
  294. left: 12px;
  295. width: 16px;
  296. height: 16px;
  297. }
  298. .app-icon {
  299. -ms-filter: 'progid:DXImageTransform.Microsoft.Alpha(Opacity=0)';
  300. opacity: 0;
  301. }
  302. }
  303. /* Apps management */
  304. #apps {
  305. max-height: calc(100vh - 100px);
  306. overflow: auto;
  307. .in-header {
  308. display: none;
  309. }
  310. }
  311. /* USER MENU -----------------------------------------------------------------*/
  312. #settings {
  313. display: inline-block;
  314. color: rgba($color-primary-text, 0.7);
  315. cursor: pointer;
  316. .icon-loading-small-dark {
  317. display: inline-block;
  318. margin-bottom: -3px;
  319. margin-right: 6px;
  320. background-size: 16px 16px;
  321. }
  322. flex: 0 0 auto;
  323. }
  324. /* User menu on the right */
  325. #expand {
  326. position: relative;
  327. display: flex;
  328. align-items: center;
  329. padding: 7px 20px 6px 10px;
  330. cursor: pointer;
  331. * {
  332. cursor: pointer;
  333. }
  334. img {
  335. -ms-filter: 'progid:DXImageTransform.Microsoft.Alpha(Opacity=70)';
  336. opacity: .7;
  337. margin-bottom: -2px;
  338. }
  339. &:hover,
  340. &:focus,
  341. &:active {
  342. color: $color-primary-text;
  343. img,
  344. #expandDisplayName {
  345. -ms-filter: 'progid:DXImageTransform.Microsoft.Alpha(Opacity=100)';
  346. opacity: 1;
  347. }
  348. }
  349. /* Profile picture in header */
  350. .avatardiv {
  351. cursor: pointer;
  352. height: 32px;
  353. width: 32px;
  354. img {
  355. opacity: 1;
  356. cursor: pointer;
  357. }
  358. /* do not show display name when profile picture is present */
  359. &.avatardiv-shown + #expandDisplayName {
  360. display: none;
  361. }
  362. }
  363. #expandDisplayName {
  364. padding: 8px;
  365. opacity: .6;
  366. }
  367. }
  368. /* full opacity for gear icon if active */
  369. #body-settings #expandDisplayName {
  370. opacity: 1;
  371. }
  372. /* show triangle below user menu if active */
  373. #body-settings #expand:before {
  374. content: ' ';
  375. height: 0;
  376. width: 0;
  377. position: absolute;
  378. pointer-events: none;
  379. border: 0 solid transparent;
  380. border-bottom-color: white;
  381. border-width: 10px;
  382. transform: translateX(-50%);
  383. left: 26px;
  384. bottom: 0;
  385. z-index: 100;
  386. display: block;
  387. }
  388. #expanddiv {
  389. right: 13px;
  390. background: $color-main-background;
  391. box-shadow: 0 1px 10px $color-box-shadow;
  392. &:after {
  393. /* position of dropdown arrow */
  394. right: 13px;
  395. }
  396. a {
  397. display: block;
  398. height: 40px;
  399. color: $color-main-text;
  400. padding: 10px 12px 0;
  401. box-sizing: border-box;
  402. -ms-filter: 'progid:DXImageTransform.Microsoft.Alpha(Opacity=70)';
  403. opacity: .7;
  404. img {
  405. margin-bottom: -3px;
  406. margin-right: 6px;
  407. }
  408. &:hover,
  409. &:focus,
  410. &:active,
  411. &.active {
  412. -ms-filter: 'progid:DXImageTransform.Microsoft.Alpha(Opacity=100)';
  413. opacity: 1;
  414. }
  415. }
  416. }
  417. #appmenu {
  418. display: inline-block;
  419. width: auto;
  420. clear: both;
  421. height: 44px;
  422. li {
  423. float: left;
  424. display: inline-block;
  425. position: relative;
  426. vertical-align: top !important;
  427. height: 45px;
  428. cursor: pointer;
  429. a {
  430. position: relative;
  431. display: inline-block;
  432. margin: 0;
  433. padding: 12px;
  434. height: 21px;
  435. text-align: center;
  436. vertical-align: top !important;
  437. opacity: .6;
  438. }
  439. }
  440. .app-loading .icon-loading-small-dark {
  441. top:12px;
  442. width: 20px;
  443. height: 20px;
  444. }
  445. li:hover a,
  446. li a.active {
  447. opacity: 1;
  448. }
  449. li img,
  450. .icon-more-white {
  451. display: inline-block;
  452. width: 20px;
  453. height: 20px;
  454. }
  455. li span {
  456. display: none;
  457. position: absolute;
  458. overflow: visible;
  459. background-color: rgba(255, 255, 255, .97);
  460. white-space: nowrap;
  461. border: none;
  462. -webkit-border-radius: 3px;
  463. -moz-border-radius: 3px;
  464. border-radius: 3px;
  465. border-top-left-radius: 0;
  466. border-top-right-radius: 0;
  467. margin-top: 0;
  468. color: rgba(0, 0, 0, .7);
  469. width: auto;
  470. left: 50%;
  471. top: 45px;
  472. transform: translateX(-50%);
  473. padding: 4px 10px;
  474. box-shadow: 0 1px 10px $color-box-shadow;
  475. }
  476. li:hover span {
  477. display: inline-block;
  478. }
  479. /* show triangle below active app */
  480. li:hover a:before,
  481. li a.active:before {
  482. content: ' ';
  483. height: 0;
  484. width: 0;
  485. position: absolute;
  486. pointer-events: none;
  487. border: 0 solid transparent;
  488. border-bottom-color: white;
  489. border-width: 10px;
  490. transform: translateX(-50%);
  491. left: 50%;
  492. bottom: 0;
  493. z-index: 100;
  494. display: none;
  495. }
  496. li a.active:before,
  497. li:hover a:before,
  498. li:hover a.active:before {
  499. display: block;
  500. }
  501. &.menu-open li:hover a:before,
  502. &.menu-open li a.active:before,
  503. &.menu-open li:hover span {
  504. display: none !important;
  505. }
  506. li.hidden {
  507. display: none;
  508. }
  509. }