You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

header.scss 7.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363
  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. @use 'variables';
  16. /* prevent ugly selection effect on accidental selection */
  17. #header,
  18. #expanddiv {
  19. -webkit-user-select: none;
  20. -moz-user-select: none;
  21. -ms-user-select: none;
  22. a:not(.button):focus-visible, button:not(.button-vue):focus-visible, div[role="button"]:focus-visible {
  23. box-shadow: inset 0 0 0 2px var(--color-primary-text);
  24. border-radius: var(--border-radius);
  25. outline: none;
  26. }
  27. }
  28. /* HEADERS ------------------------------------------------------------------ */
  29. #body-user #header,
  30. #body-settings #header,
  31. #body-public #header {
  32. display: inline-flex;
  33. position: fixed;
  34. top: 0;
  35. width: 100%;
  36. z-index: 2000;
  37. height: variables.$header-height;
  38. box-sizing: border-box;
  39. justify-content: space-between;
  40. }
  41. /* LOGO and APP NAME -------------------------------------------------------- */
  42. #nextcloud {
  43. padding: 5px 0;
  44. padding-left: 86px; // logo width + 2* pa
  45. position: relative;
  46. height: calc(100% - 4px);
  47. box-sizing: border-box;
  48. opacity: 1;
  49. align-items: center;
  50. display: flex;
  51. flex-wrap: wrap;
  52. overflow: hidden;
  53. margin: 2px;
  54. &:hover, &:active {
  55. opacity: 1;
  56. }
  57. }
  58. @mixin header-menu-height() {
  59. min-height: calc(44px * 1.5); // show at least 1.5 entries
  60. max-height: calc(100vh - #{variables.$header-height} * 4);
  61. }
  62. #header {
  63. /* Header menu */
  64. $header-menu-entry-height: 44px;
  65. .header-right > div > .menu {
  66. background-color: var(--color-main-background);
  67. filter: drop-shadow(0 1px 5px var(--color-box-shadow));
  68. border-radius: 0 0 var(--border-radius) var(--border-radius);
  69. box-sizing: border-box;
  70. z-index: 2000;
  71. position: absolute;
  72. max-width: 350px;
  73. @include header-menu-height();
  74. right: 5px; // relative to parent
  75. top: variables.$header-height;
  76. margin: 0;
  77. &:not(.popovermenu) {
  78. display: none;
  79. }
  80. /* Dropdown arrow */
  81. &:after {
  82. border: 10px solid transparent;
  83. border-bottom-color: var(--color-main-background);
  84. bottom: 100%;
  85. content: ' ';
  86. height: 0;
  87. width: 0;
  88. position: absolute;
  89. pointer-events: none;
  90. right: 10px;
  91. }
  92. & > div,
  93. & > ul {
  94. overflow-y: auto;
  95. -webkit-overflow-scrolling: touch;
  96. @include header-menu-height();
  97. }
  98. /* Use by the settings right menu */
  99. &.settings-menu > ul {
  100. li {
  101. a {
  102. display: inline-flex;
  103. align-items: center;
  104. height: $header-menu-entry-height;
  105. color: var(--color-main-text);
  106. padding: 10px 12px;
  107. box-sizing: border-box;
  108. white-space: nowrap;
  109. position: relative;
  110. width: 100%;
  111. &:hover,
  112. &:focus {
  113. background-color: var(--color-background-hover);
  114. }
  115. &:active,
  116. &.active {
  117. background-color: var(--color-primary-light);
  118. }
  119. &:focus-visible {
  120. box-shadow: inset 0 0 0 2px var(--color-primary);
  121. outline: none;
  122. }
  123. span {
  124. display: inline-block;
  125. padding-bottom: 0;
  126. color: var(--color-main-text);
  127. white-space: nowrap;
  128. overflow: hidden;
  129. text-overflow: ellipsis;
  130. max-width: 110px;
  131. }
  132. .icon-loading-small {
  133. margin-right: 10px;
  134. background-size: 16px 16px;
  135. }
  136. img,
  137. svg {
  138. opacity: .7;
  139. margin-right: 10px;
  140. height: 16px;
  141. width: 16px;
  142. filter: var(--background-invert-if-dark);
  143. }
  144. }
  145. }
  146. }
  147. }
  148. .logo {
  149. display: inline-flex;
  150. background-image: var(--image-logoheader, var(--image-logo, url('../img/logo/logo.svg')));
  151. background-repeat: no-repeat;
  152. background-size: contain;
  153. background-position: center;
  154. width: 62px;
  155. position: absolute;
  156. left: 12px;
  157. top: 1px;
  158. bottom: 1px;
  159. }
  160. .header-appname-container {
  161. display: none;
  162. padding-right: 10px;
  163. flex-shrink: 0;
  164. }
  165. #header-left, .header-left,
  166. #header-right, .header-right {
  167. display: inline-flex;
  168. align-items: center;
  169. }
  170. #header-left, .header-left {
  171. flex: 1 0;
  172. white-space: nowrap;
  173. min-width: 0;
  174. }
  175. #header-right, .header-right {
  176. justify-content: flex-end;
  177. flex-shrink: 1;
  178. }
  179. /* Right header standard */
  180. .header-right {
  181. > div,
  182. > form {
  183. height: 100%;
  184. position: relative;
  185. > .menutoggle {
  186. display: flex;
  187. justify-content: center;
  188. align-items: center;
  189. width: variables.$header-height;
  190. height: 44px;
  191. cursor: pointer;
  192. opacity: 0.85;
  193. padding: 0;
  194. margin: 2px 0;
  195. &:focus {
  196. opacity: 1;
  197. }
  198. &:focus-visible {
  199. outline: none;
  200. }
  201. }
  202. }
  203. }
  204. }
  205. /* hover effect for app switcher label */
  206. .header-appname-container .header-appname {
  207. opacity: .75;
  208. }
  209. /* TODO: move into minimal css file for public shared template */
  210. /* only used for public share pages now as we have the app icons when logged in */
  211. .header-appname {
  212. color: var(--color-primary-text);
  213. font-size: 16px;
  214. font-weight: bold;
  215. margin: 0;
  216. padding: 0;
  217. padding-right: 5px;
  218. overflow: hidden;
  219. text-overflow: ellipsis;
  220. // Take full width to push the header-shared-by bellow (if any)
  221. flex: 1 1 100%;
  222. }
  223. .header-shared-by {
  224. color: var(--color-primary-text);
  225. position: relative;
  226. font-weight: 300;
  227. font-size: 11px;
  228. line-height: 11px;
  229. overflow: hidden;
  230. text-overflow: ellipsis;
  231. }
  232. /* USER MENU -----------------------------------------------------------------*/
  233. #settings {
  234. display: inline-block;
  235. height: 100%;
  236. cursor: pointer;
  237. flex: 0 0 auto;
  238. /* User menu on the right */
  239. #expand {
  240. opacity: 1; /* override icon opacity */
  241. margin-right: 12px;
  242. &:hover,
  243. &:focus,
  244. &:active {
  245. color: var(--color-primary-text);
  246. #expandDisplayName,
  247. .avatardiv{
  248. border-radius: 50%;
  249. border: 2px solid var(--color-primary-text);
  250. margin: -2px;
  251. }
  252. .avatardiv{
  253. background-color: var(--color-primary-text);
  254. }
  255. #expandDisplayName {
  256. opacity: 1;
  257. }
  258. }
  259. /* Profile picture in header */
  260. .avatardiv {
  261. cursor: pointer;
  262. height: 32px;
  263. width: 32px;
  264. img {
  265. opacity: 1;
  266. cursor: pointer;
  267. }
  268. /* do not show display name when profile picture is present */
  269. &.avatardiv-shown + #expandDisplayName {
  270. display: none;
  271. }
  272. }
  273. #expandDisplayName {
  274. padding: 8px;
  275. opacity: .6;
  276. cursor: pointer;
  277. /* full opacity for gear icon if active */
  278. #body-settings & {
  279. opacity: 1;
  280. }
  281. }
  282. /* show triangle below user menu if active */
  283. #body-settings &:before {
  284. content: ' ';
  285. height: 0;
  286. width: 0;
  287. position: absolute;
  288. pointer-events: none;
  289. border: 0 solid transparent;
  290. border-bottom-color: var(--color-main-background);
  291. border-width: 10px;
  292. bottom: 0;
  293. z-index: 100;
  294. display: block;
  295. }
  296. }
  297. #expanddiv:after {
  298. right: 22px;
  299. }
  300. }
  301. /* Skip navigation links – show only on keyboard focus */
  302. #skip-actions {
  303. position: absolute;
  304. overflow: hidden;
  305. z-index: 9999;
  306. top: -999px;
  307. left: 3px;
  308. height: 50px;
  309. padding: 11px;
  310. &:focus-within {
  311. top: variables.$header-height;
  312. }
  313. }
  314. /* Empty content messages in the header e.g. notifications, contacts menu, … */
  315. header #emptycontent,
  316. header .emptycontent {
  317. h2 {
  318. font-weight: normal;
  319. font-size: 16px;
  320. }
  321. [class^='icon-'],
  322. [class*='icon-'] {
  323. background-size: 48px;
  324. height: 48px;
  325. width: 48px;
  326. }
  327. }