header.scss 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290
  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. --color-primary-text: var(--background-image-color-text, #ffffff);
  86. .header-right > div > .menu {
  87. background-color: var(--color-main-background);
  88. filter: drop-shadow(0 1px 5px var(--color-box-shadow));
  89. border-radius: var(--border-radius-large);
  90. box-sizing: border-box;
  91. z-index: 2000;
  92. position: absolute;
  93. max-width: 350px;
  94. @include header-menu-height();
  95. right: 8px; // relative to parent
  96. top: variables.$header-height;
  97. margin: 0;
  98. overflow-y: auto;
  99. &:not(.popovermenu) {
  100. display: none;
  101. }
  102. /* Dropdown arrow */
  103. &:after {
  104. border: 10px solid transparent;
  105. border-bottom-color: var(--color-main-background);
  106. bottom: 100%;
  107. content: ' ';
  108. height: 0;
  109. width: 0;
  110. position: absolute;
  111. pointer-events: none;
  112. right: 10px;
  113. }
  114. & > div,
  115. & > ul {
  116. -webkit-overflow-scrolling: touch;
  117. @include header-menu-height();
  118. }
  119. }
  120. .logo {
  121. display: inline-flex;
  122. background-image: var(--image-logoheader, var(--image-logo, url('../img/logo/logo.svg')));
  123. background-repeat: no-repeat;
  124. background-size: contain;
  125. background-position: center;
  126. width: 62px;
  127. position: absolute;
  128. left: 12px;
  129. top: 1px;
  130. bottom: 1px;
  131. // Invert if not customized and background is bright
  132. filter: var(--image-logoheader-custom, var(--background-image-invert-if-bright));
  133. }
  134. .header-appname-container {
  135. display: none;
  136. padding-right: 10px;
  137. flex-shrink: 0;
  138. }
  139. #header-left, .header-left,
  140. #header-right, .header-right {
  141. display: inline-flex;
  142. align-items: center;
  143. }
  144. #header-left, .header-left {
  145. flex: 1 0;
  146. white-space: nowrap;
  147. min-width: 0;
  148. }
  149. #header-right, .header-right {
  150. justify-content: flex-end;
  151. flex-shrink: 1;
  152. }
  153. /* Right header standard */
  154. .header-right {
  155. > .header-menu:not(.user-menu) {
  156. // For general
  157. > .header-menu__trigger {
  158. filter: var(--background-image-invert-if-bright);
  159. }
  160. // For assistant button
  161. > .trigger {
  162. filter: var(--background-image-invert-if-bright);
  163. }
  164. // For unified search button
  165. .unified-search__trigger {
  166. filter: var(--background-image-invert-if-bright) !important;
  167. }
  168. }
  169. > div,
  170. > form {
  171. height: 100%;
  172. position: relative;
  173. > .menutoggle {
  174. display: flex;
  175. justify-content: center;
  176. align-items: center;
  177. width: variables.$header-height;
  178. height: 44px;
  179. cursor: pointer;
  180. opacity: 0.85;
  181. padding: 0;
  182. margin: 2px 0;
  183. &:focus {
  184. opacity: 1;
  185. }
  186. &:focus-visible {
  187. outline: none;
  188. }
  189. }
  190. }
  191. }
  192. }
  193. /* hover effect for app switcher label */
  194. .header-appname-container .header-appname {
  195. opacity: .75;
  196. }
  197. /* TODO: move into minimal css file for public shared template */
  198. /* only used for public share pages now as we have the app icons when logged in */
  199. .header-appname {
  200. color: var(--color-primary-element-text);
  201. font-size: 16px;
  202. font-weight: bold;
  203. margin: 0;
  204. padding: 0;
  205. padding-right: 5px;
  206. overflow: hidden;
  207. text-overflow: ellipsis;
  208. // Take full width to push the header-shared-by bellow (if any)
  209. flex: 1 1 100%;
  210. }
  211. .header-info {
  212. display: flex;
  213. flex-direction: column;
  214. overflow: hidden;
  215. }
  216. .header-title {
  217. overflow: hidden;
  218. text-overflow: ellipsis;
  219. }
  220. .header-shared-by {
  221. color: var(--color-primary-element-text);
  222. position: relative;
  223. font-weight: 300;
  224. font-size: 11px;
  225. line-height: 11px;
  226. overflow: hidden;
  227. text-overflow: ellipsis;
  228. }
  229. /* Skip navigation links – show only on keyboard focus */
  230. #skip-actions {
  231. position: absolute;
  232. overflow: hidden;
  233. z-index: 9999;
  234. top: -999px;
  235. left: 3px;
  236. padding: 11px;
  237. display: flex;
  238. flex-wrap: wrap;
  239. gap: 11px;
  240. &:focus-within {
  241. top: variables.$header-height;
  242. }
  243. }
  244. /* Empty content messages in the header e.g. notifications, contacts menu, … */
  245. header #emptycontent,
  246. header .emptycontent {
  247. h2 {
  248. font-weight: normal;
  249. font-size: 16px;
  250. }
  251. [class^='icon-'],
  252. [class*='icon-'] {
  253. background-size: 48px;
  254. height: 48px;
  255. width: 48px;
  256. }
  257. }