header.scss 7.6 KB

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