header.scss 8.0 KB

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