theming.scss 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228
  1. /** Calculate luma as it is also used in OCA\Theming\Util::calculateLuma */
  2. @function luma($c) {
  3. $-local-red: red(rgba($c, 1.0));
  4. $-local-green: green(rgba($c, 1.0));
  5. $-local-blue: blue(rgba($c, 1.0));
  6. @return (0.2126 * $-local-red + 0.7152 * $-local-green + 0.0722 * $-local-blue) / 255;
  7. }
  8. $has-custom-logo: variable_exists('theming-logo-mime') and $theming-logo-mime != '';
  9. $invert: luma($color-primary) > 0.6;
  10. @if ($has-custom-logo == false) {
  11. @if ($invert) {
  12. $image-logo: url(icon-color-path('logo', 'logo', #000000, 1, true));
  13. } @else {
  14. $image-logo: url(icon-color-path('logo', 'logo', #ffffff, 1, true));
  15. }
  16. }
  17. .nc-theming-main-background {
  18. background-color: $color-primary;
  19. }
  20. .nc-theming-main-text {
  21. color: $color-primary-text;
  22. }
  23. .nc-theming-contrast {
  24. color: $color-primary-text;
  25. }
  26. @if ($invert) {
  27. #appmenu:not(.inverted) svg {
  28. filter: invert(1);
  29. }
  30. #appmenu.inverted svg {
  31. filter: none;
  32. }
  33. .searchbox input[type="search"] {
  34. background-repeat: no-repeat;
  35. background-position: 6px center;
  36. background-color: transparent;
  37. @include icon-color('search', 'actions', $color-black, 1, true);
  38. }
  39. #contactsmenu .icon-contacts {
  40. @include icon-color('contacts', 'places', $color-black, 1, true);
  41. }
  42. #settings .icon-settings-white {
  43. @include icon-color('settings', 'actions', $color-black, 1, true);
  44. }
  45. #appmenu .icon-more-white {
  46. @include icon-color('more', 'actions', $color-black, 1, true);
  47. }
  48. #body-login {
  49. input,
  50. #alternative-logins li a {
  51. border: 1px solid nc-lighten($color-primary-text, 50%);
  52. }
  53. input.primary,
  54. #alternative-logins li a {
  55. background-color: $color-primary;
  56. }
  57. a,
  58. label,
  59. p,
  60. #alternative-logins legend {
  61. color: var(--color-primary-text);
  62. }
  63. input[type='checkbox'].checkbox--white + label:before {
  64. border-color: nc-darken($color-primary-element, 40%) !important;
  65. }
  66. input[type='checkbox'].checkbox--white:not(:disabled):not(:checked) + label:hover:before,
  67. input[type='checkbox'].checkbox--white:focus + label:before {
  68. border-color: nc-darken($color-primary-element, 30%) !important;
  69. }
  70. input[type='checkbox'].checkbox--white:checked + label:before {
  71. border-color: nc-darken($color-primary-element, 30%) !important;
  72. background-color: nc-darken($color-primary-element, 30%) !important;
  73. @include icon-color('checkbox-mark', 'actions', $color-white, 1, true);
  74. }
  75. }
  76. /* Always give primary button a border for light primary colors */
  77. .primary {
  78. border-color: var(--color-border) !important;
  79. }
  80. } @else {
  81. #appmenu:not(.inverted) svg {
  82. filter: none;
  83. }
  84. #appmenu.inverted svg {
  85. filter: invert(1);
  86. }
  87. }
  88. /* Colorized svg images */
  89. .icon-file, .icon-filetype-text {
  90. background-image: url(./img/core/filetypes/text.svg?v=#{$theming-cachebuster});
  91. }
  92. .icon-folder, .icon-filetype-folder {
  93. background-image: url(./img/core/filetypes/folder.svg?v=#{$theming-cachebuster});
  94. }
  95. .icon-filetype-folder-drag-accept {
  96. background-image: url(./img/core/filetypes/folder-drag-accept.svg?v=#{$theming-cachebuster}) !important;
  97. }
  98. #theming-preview-logo,
  99. #header .logo {
  100. background-image: $image-logo;
  101. }
  102. /* override styles for login screen in guest.css */
  103. @if ($has-custom-logo) {
  104. // custom logo
  105. #theming-preview-logo,
  106. #header .logo {
  107. background-size: contain;
  108. }
  109. #body-login #header .logo {
  110. margin-bottom: 22px;
  111. }
  112. } @else {
  113. // default logo
  114. @if ($invert) {
  115. #theming-preview-logo,
  116. #header .logo {
  117. opacity: .6;
  118. }
  119. }
  120. }
  121. @if variable_exists('theming-background-mime') and $theming-background-mime != '' {
  122. #body-login,
  123. #firstrunwizard .firstrunwizard-header,
  124. #theming-preview {
  125. background-image: $image-login-background;
  126. background-color: $color-primary;
  127. }
  128. } @else {
  129. #theming-preview {
  130. background-image: $image-login-background;
  131. background-color: $color-primary;
  132. }
  133. }
  134. @if variable_exists('theming-logoheader-mime') and $theming-logoheader-mime != '' {
  135. #theming .advanced-option-logoheader .image-preview,
  136. body:not(#body-login) #header .logo {
  137. background-image: url(#{$image-logoheader});
  138. }
  139. } @else {
  140. #theming .advanced-option-favicon .image-preview {
  141. background-image: none;
  142. }
  143. }
  144. @if variable_exists('theming-favicon-mime') and $theming-favicon-mime != '' {
  145. #theming .advanced-option-favicon .image-preview {
  146. background-image: url(#{$image-favicon});
  147. }
  148. } @else {
  149. #theming .advanced-option-favicon .image-preview {
  150. background-image: none;
  151. }
  152. }
  153. input.primary,
  154. #alternative-logins li a {
  155. background-color: $color-primary-element;
  156. border: 1px solid $color-primary-text;
  157. color: $color-primary-text;
  158. }
  159. @if ($invert) {
  160. #body-login #submit-wrapper .icon-confirm-white {
  161. background-image: url('../../../core/img/actions/confirm.svg');
  162. }
  163. }
  164. // plain background color for login page
  165. @if $image-login-plain == 'true' {
  166. #body-login, #firstrunwizard .firstrunwizard-header, #theming-preview {
  167. background-image: none !important;
  168. background-color: $color-primary;
  169. }
  170. #body-login {
  171. a, label, p {
  172. color: var(--color-primary-text);
  173. }
  174. }
  175. } @else {
  176. #body-login {
  177. background-color: $color-primary;
  178. }
  179. }
  180. @if ($color-primary == #ffffff) {
  181. /* show grey border below header */
  182. #body-user #header,
  183. #body-settings #header,
  184. #body-public #header {
  185. border-bottom: 1px solid #ebebeb;
  186. }
  187. /* show triangle in header in grey */
  188. #appmenu li a.active:before,
  189. .header-right #settings #expand:before {
  190. border-bottom-color:#ebebeb;
  191. }
  192. /* show border around quota bar in files app */
  193. .app-files #quota .quota-container {
  194. border: 1px solid #ebebeb;
  195. }
  196. }
  197. @if ($has-legal-links == 'true') {
  198. footer {
  199. height: 92px;
  200. }
  201. }