header.scss 10 KB

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