header.scss 5.5 KB

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