header.scss 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271
  1. /*!
  2. * SPDX-FileCopyrightText: 2016-2024 Nextcloud GmbH and Nextcloud contributors
  3. * SPDX-FileCopyrightText: 2016 ownCloud, Inc.
  4. * SPDX-License-Identifier: AGPL-3.0-or-later
  5. */
  6. @use 'variables';
  7. /* prevent ugly selection effect on accidental selection */
  8. #header,
  9. #expanddiv {
  10. -webkit-user-select: none;
  11. -moz-user-select: none;
  12. -ms-user-select: none;
  13. user-select: none;
  14. #nextcloud:focus-visible,
  15. .app-menu-entry a:focus-visible,
  16. .header-menu button:first-of-type:focus-visible {
  17. outline: none;
  18. &::after {
  19. content: " ";
  20. position: absolute;
  21. inset-block-end: 2px;
  22. transform: translateX(-50%);
  23. width: 12px;
  24. height: 2px;
  25. border-radius: 3px;
  26. background-color: var(--color-background-plain-text);
  27. inset-inline-start: 50%;
  28. opacity: 1;
  29. }
  30. }
  31. .header-right {
  32. // Add some spacing so the last entry looks ok
  33. margin-inline-end: calc(3 * var(--default-grid-baseline));
  34. a:not(.button):focus-visible::after, div[role=button]:focus-visible::after {
  35. bottom: 4px;
  36. }
  37. #expand.menutoggle:focus-visible::after {
  38. left: 40%;
  39. }
  40. }
  41. }
  42. /* HEADERS ------------------------------------------------------------------ */
  43. #body-user #header,
  44. #body-settings #header,
  45. #body-public #header {
  46. display: inline-flex;
  47. position: absolute;
  48. top: 0;
  49. width: 100%;
  50. z-index: 2000;
  51. height: variables.$header-height;
  52. box-sizing: border-box;
  53. justify-content: space-between;
  54. }
  55. /* LOGO and APP NAME -------------------------------------------------------- */
  56. #nextcloud {
  57. padding: 5px 0;
  58. padding-left: 86px; // logo width + 2* pa
  59. position: relative;
  60. height: calc(100% - 4px);
  61. box-sizing: border-box;
  62. opacity: 1;
  63. align-items: center;
  64. display: flex;
  65. flex-wrap: wrap;
  66. overflow: hidden;
  67. margin: 2px;
  68. &:hover, &:active {
  69. opacity: 1;
  70. }
  71. }
  72. @mixin header-menu-height() {
  73. min-height: calc(44px * 1.5); // show at least 1.5 entries
  74. max-height: calc(100vh - #{variables.$header-height} - 8px);
  75. }
  76. #header {
  77. /* Header menu */
  78. $header-menu-entry-height: 44px;
  79. .header-right > div > .menu {
  80. background-color: var(--color-main-background);
  81. filter: drop-shadow(0 1px 5px var(--color-box-shadow));
  82. border-radius: var(--border-radius-large);
  83. box-sizing: border-box;
  84. z-index: 2000;
  85. position: absolute;
  86. max-width: 350px;
  87. @include header-menu-height();
  88. right: 8px; // relative to parent
  89. top: variables.$header-height;
  90. margin: 0;
  91. overflow-y: auto;
  92. &:not(.popovermenu) {
  93. display: none;
  94. }
  95. /* Dropdown arrow */
  96. &:after {
  97. border: 10px solid transparent;
  98. border-bottom-color: var(--color-main-background);
  99. bottom: 100%;
  100. content: ' ';
  101. height: 0;
  102. width: 0;
  103. position: absolute;
  104. pointer-events: none;
  105. right: 10px;
  106. }
  107. & > div,
  108. & > ul {
  109. -webkit-overflow-scrolling: touch;
  110. @include header-menu-height();
  111. }
  112. }
  113. .logo {
  114. display: inline-flex;
  115. background-image: var(--image-logoheader, var(--image-logo, url('../img/logo/logo.svg')));
  116. background-repeat: no-repeat;
  117. background-size: contain;
  118. background-position: center;
  119. width: 62px;
  120. position: absolute;
  121. left: 12px;
  122. top: 1px;
  123. bottom: 1px;
  124. // Invert if not customized and background is bright
  125. filter: var(--image-logoheader-custom, var(--background-image-invert-if-bright));
  126. }
  127. .header-appname-container {
  128. display: none;
  129. padding-right: 10px;
  130. flex-shrink: 0;
  131. }
  132. #header-left, .header-left,
  133. #header-right, .header-right {
  134. display: inline-flex;
  135. align-items: center;
  136. }
  137. #header-left, .header-left {
  138. flex: 1 0;
  139. white-space: nowrap;
  140. min-width: 0;
  141. }
  142. #header-right, .header-right {
  143. justify-content: flex-end;
  144. flex-shrink: 1;
  145. }
  146. /* Right header standard */
  147. .header-right {
  148. > .header-menu__trigger img {
  149. filter: var(--background-image-invert-if-bright);
  150. }
  151. > div,
  152. > form {
  153. height: 100%;
  154. position: relative;
  155. > .menutoggle {
  156. display: flex;
  157. justify-content: center;
  158. align-items: center;
  159. width: variables.$header-height;
  160. height: 44px;
  161. cursor: pointer;
  162. opacity: 0.85;
  163. padding: 0;
  164. margin: 2px 0;
  165. &:focus {
  166. opacity: 1;
  167. }
  168. &:focus-visible {
  169. outline: none;
  170. }
  171. }
  172. }
  173. }
  174. }
  175. /* hover effect for app switcher label */
  176. .header-appname-container .header-appname {
  177. opacity: .75;
  178. }
  179. /* TODO: move into minimal css file for public shared template */
  180. /* only used for public share pages now as we have the app icons when logged in */
  181. .header-appname {
  182. color: var(--color-background-plain-text);
  183. font-size: 16px;
  184. font-weight: bold;
  185. margin: 0;
  186. padding: 0;
  187. padding-right: 5px;
  188. overflow: hidden;
  189. text-overflow: ellipsis;
  190. // Take full width to push the header-shared-by bellow (if any)
  191. flex: 1 1 100%;
  192. }
  193. .header-info {
  194. display: flex;
  195. flex-direction: column;
  196. overflow: hidden;
  197. }
  198. .header-title {
  199. overflow: hidden;
  200. text-overflow: ellipsis;
  201. }
  202. .header-shared-by {
  203. color: var(--color-background-plain-text);
  204. position: relative;
  205. font-weight: 300;
  206. font-size: 11px;
  207. line-height: 11px;
  208. overflow: hidden;
  209. text-overflow: ellipsis;
  210. }
  211. /* Skip navigation links – show only on keyboard focus */
  212. #skip-actions {
  213. position: absolute;
  214. overflow: hidden;
  215. z-index: 9999;
  216. top: -999px;
  217. left: 3px;
  218. padding: 11px;
  219. display: flex;
  220. flex-wrap: wrap;
  221. gap: 11px;
  222. &:focus-within {
  223. top: variables.$header-height;
  224. }
  225. }
  226. /* Empty content messages in the header e.g. notifications, contacts menu, … */
  227. header #emptycontent,
  228. header .emptycontent {
  229. h2 {
  230. font-weight: normal;
  231. font-size: 16px;
  232. }
  233. [class^='icon-'],
  234. [class*='icon-'] {
  235. background-size: 48px;
  236. height: 48px;
  237. width: 48px;
  238. }
  239. }