1
0

header.scss 8.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396
  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. background-image: var(--image-logoheader, var(--image-logo, url('../img/logo/logo.svg')));
  176. background-repeat: no-repeat;
  177. background-size: contain;
  178. background-position: center;
  179. width: 62px;
  180. position: absolute;
  181. left: 12px;
  182. top: 1px;
  183. bottom: 1px;
  184. // Invert if not customized and background is bright
  185. filter: var(--image-logoheader-custom, var(--background-image-invert-if-bright));
  186. }
  187. .header-appname-container {
  188. display: none;
  189. padding-right: 10px;
  190. flex-shrink: 0;
  191. }
  192. #header-left, .header-left,
  193. #header-right, .header-right {
  194. display: inline-flex;
  195. align-items: center;
  196. }
  197. #header-left, .header-left {
  198. flex: 1 0;
  199. white-space: nowrap;
  200. min-width: 0;
  201. }
  202. #header-right, .header-right {
  203. justify-content: flex-end;
  204. flex-shrink: 1;
  205. }
  206. /* Right header standard */
  207. .header-right {
  208. > div,
  209. > form {
  210. height: 100%;
  211. position: relative;
  212. > .menutoggle {
  213. display: flex;
  214. justify-content: center;
  215. align-items: center;
  216. width: variables.$header-height;
  217. height: 44px;
  218. cursor: pointer;
  219. opacity: 0.85;
  220. padding: 0;
  221. margin: 2px 0;
  222. &:focus {
  223. opacity: 1;
  224. }
  225. &:focus-visible {
  226. outline: none;
  227. }
  228. }
  229. }
  230. }
  231. }
  232. /* hover effect for app switcher label */
  233. .header-appname-container .header-appname {
  234. opacity: .75;
  235. }
  236. /* TODO: move into minimal css file for public shared template */
  237. /* only used for public share pages now as we have the app icons when logged in */
  238. .header-appname {
  239. color: var(--color-primary-text);
  240. font-size: 16px;
  241. font-weight: bold;
  242. margin: 0;
  243. padding: 0;
  244. padding-right: 5px;
  245. overflow: hidden;
  246. text-overflow: ellipsis;
  247. // Take full width to push the header-shared-by bellow (if any)
  248. flex: 1 1 100%;
  249. }
  250. .header-shared-by {
  251. color: var(--color-primary-text);
  252. position: relative;
  253. font-weight: 300;
  254. font-size: 11px;
  255. line-height: 11px;
  256. overflow: hidden;
  257. text-overflow: ellipsis;
  258. }
  259. /* USER MENU -----------------------------------------------------------------*/
  260. #settings {
  261. display: inline-block;
  262. height: 100%;
  263. cursor: pointer;
  264. flex: 0 0 auto;
  265. /* User menu on the right */
  266. #expand {
  267. opacity: 1; /* override icon opacity */
  268. margin-right: 12px;
  269. &:hover,
  270. &:focus,
  271. &:active {
  272. color: var(--color-primary-text);
  273. #expandDisplayName,
  274. .avatardiv{
  275. border-radius: 50%;
  276. border: 2px solid var(--color-primary-text);
  277. margin: -2px;
  278. }
  279. .avatardiv{
  280. background-color: var(--color-primary-text);
  281. }
  282. #expandDisplayName {
  283. opacity: 1;
  284. }
  285. }
  286. /* Profile picture in header */
  287. .avatardiv {
  288. cursor: pointer;
  289. height: 32px;
  290. width: 32px;
  291. img {
  292. opacity: 1;
  293. cursor: pointer;
  294. }
  295. /* do not show display name when profile picture is present */
  296. &.avatardiv-shown + #expandDisplayName {
  297. display: none;
  298. }
  299. }
  300. #expandDisplayName {
  301. padding: 8px;
  302. opacity: .6;
  303. cursor: pointer;
  304. /* full opacity for gear icon if active */
  305. #body-settings & {
  306. opacity: 1;
  307. }
  308. }
  309. /* show triangle below user menu if active */
  310. #body-settings &:before {
  311. content: ' ';
  312. height: 0;
  313. width: 0;
  314. position: absolute;
  315. pointer-events: none;
  316. bottom: 2px;
  317. z-index: 100;
  318. display: block;
  319. width: 10px;
  320. height: 5px;
  321. border-radius: 3px;
  322. background-color: var(--color-primary-text);
  323. }
  324. }
  325. #expanddiv:after {
  326. right: 22px;
  327. }
  328. }
  329. /* Skip navigation links – show only on keyboard focus */
  330. #skip-actions {
  331. position: absolute;
  332. overflow: hidden;
  333. z-index: 9999;
  334. top: -999px;
  335. left: 3px;
  336. height: 50px;
  337. padding: 11px;
  338. &:focus-within {
  339. top: variables.$header-height;
  340. }
  341. }
  342. /* Empty content messages in the header e.g. notifications, contacts menu, … */
  343. header #emptycontent,
  344. header .emptycontent {
  345. h2 {
  346. font-weight: normal;
  347. font-size: 16px;
  348. }
  349. [class^='icon-'],
  350. [class*='icon-'] {
  351. background-size: 48px;
  352. height: 48px;
  353. width: 48px;
  354. }
  355. }