theming.scss 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230
  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. button.primary,
  55. #alternative-logins li a {
  56. background-color: $color-primary;
  57. color: $color-primary-text;
  58. }
  59. a,
  60. label,
  61. p,
  62. #alternative-logins legend {
  63. color: $color-primary-text;
  64. }
  65. input[type='checkbox'].checkbox--white + label:before {
  66. border-color: nc-darken($color-primary-element, 40%) !important;
  67. }
  68. input[type='checkbox'].checkbox--white:not(:disabled):not(:checked) + label:hover:before,
  69. input[type='checkbox'].checkbox--white:focus + label:before {
  70. border-color: nc-darken($color-primary-element, 30%) !important;
  71. }
  72. input[type='checkbox'].checkbox--white:checked + label:before {
  73. border-color: nc-darken($color-primary-element, 30%) !important;
  74. background-color: nc-darken($color-primary-element, 30%) !important;
  75. @include icon-color('checkbox-mark', 'actions', $color-white, 1, true);
  76. }
  77. }
  78. /* Always give primary button a border for light primary colors */
  79. .primary {
  80. border-color: $color-border !important;
  81. }
  82. } @else {
  83. #appmenu:not(.inverted) svg {
  84. filter: none;
  85. }
  86. #appmenu.inverted svg {
  87. filter: invert(1);
  88. }
  89. }
  90. /* Colorized svg images */
  91. .icon-file, .icon-filetype-text {
  92. background-image: url(./img/core/filetypes/text.svg?v=#{$theming-cachebuster});
  93. }
  94. .icon-folder, .icon-filetype-folder {
  95. background-image: url(./img/core/filetypes/folder.svg?v=#{$theming-cachebuster});
  96. }
  97. .icon-filetype-folder-drag-accept {
  98. background-image: url(./img/core/filetypes/folder-drag-accept.svg?v=#{$theming-cachebuster}) !important;
  99. }
  100. #theming-preview-logo,
  101. #header .logo {
  102. background-image: $image-logo;
  103. }
  104. /* override styles for login screen in guest.css */
  105. @if ($has-custom-logo) {
  106. // custom logo
  107. #theming-preview-logo,
  108. #header .logo {
  109. background-size: contain;
  110. }
  111. #body-login #header .logo {
  112. margin-bottom: 22px;
  113. }
  114. } @else {
  115. // default logo
  116. @if ($invert) {
  117. #theming-preview-logo,
  118. #header .logo {
  119. opacity: .6;
  120. }
  121. }
  122. }
  123. @if variable_exists('theming-background-mime') and $theming-background-mime != '' {
  124. #body-login,
  125. #firstrunwizard .firstrunwizard-header,
  126. #theming-preview {
  127. background-image: $image-login-background;
  128. background-color: $color-primary;
  129. }
  130. } @else {
  131. #theming-preview {
  132. background-image: $image-login-background;
  133. background-color: $color-primary;
  134. }
  135. }
  136. @if variable_exists('theming-logoheader-mime') and $theming-logoheader-mime != '' {
  137. #theming .advanced-option-logoheader .image-preview,
  138. body:not(#body-login) #header .logo {
  139. background-image: url(#{$image-logoheader});
  140. }
  141. } @else {
  142. #theming .advanced-option-favicon .image-preview {
  143. background-image: none;
  144. }
  145. }
  146. @if variable_exists('theming-favicon-mime') and $theming-favicon-mime != '' {
  147. #theming .advanced-option-favicon .image-preview {
  148. background-image: url(#{$image-favicon});
  149. }
  150. } @else {
  151. #theming .advanced-option-favicon .image-preview {
  152. background-image: none;
  153. }
  154. }
  155. input.primary,
  156. #alternative-logins li a {
  157. background-color: $color-primary-element;
  158. border: 1px solid $color-primary-text;
  159. color: $color-primary-text;
  160. }
  161. @if ($invert) {
  162. #body-login #submit-wrapper .icon-confirm-white {
  163. background-image: url('../../../core/img/actions/confirm.svg');
  164. }
  165. }
  166. // plain background color for login page
  167. @if $image-login-plain == 'true' {
  168. #body-login, #firstrunwizard .firstrunwizard-header, #theming-preview {
  169. background-image: none !important;
  170. background-color: $color-primary;
  171. }
  172. #body-login {
  173. a, label, p {
  174. color: $color-primary-text;
  175. }
  176. }
  177. } @else {
  178. #body-login {
  179. background-color: $color-primary;
  180. }
  181. }
  182. @if ($color-primary == #ffffff) {
  183. /* show grey border below header */
  184. #body-user #header,
  185. #body-settings #header,
  186. #body-public #header {
  187. border-bottom: 1px solid #ebebeb;
  188. }
  189. /* show triangle in header in grey */
  190. #appmenu li a.active:before,
  191. .header-right #settings #expand:before {
  192. border-bottom-color:#ebebeb;
  193. }
  194. /* show border around quota bar in files app */
  195. .app-files #quota .quota-container {
  196. border: 1px solid #ebebeb;
  197. }
  198. }
  199. @if ($has-legal-links == 'true') {
  200. footer {
  201. height: 92px;
  202. }
  203. }