theming.scss 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268
  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. .lost-password-container #lost-password {
  64. color: $color-primary-text;
  65. }
  66. input[type='checkbox'].checkbox--white + label:before {
  67. border-color: nc-darken($color-primary-element, 40%) !important;
  68. }
  69. input[type='checkbox'].checkbox--white:not(:disabled):not(:checked) + label:hover:before,
  70. input[type='checkbox'].checkbox--white:focus + label:before {
  71. border-color: nc-darken($color-primary-element, 30%) !important;
  72. }
  73. input[type='checkbox'].checkbox--white:checked + label:before {
  74. border-color: nc-darken($color-primary-element, 30%) !important;
  75. background-color: nc-darken($color-primary-element, 30%) !important;
  76. @include icon-color('checkbox-mark', 'actions', $color-white, 1, true);
  77. }
  78. }
  79. } @else {
  80. #appmenu:not(.inverted) svg {
  81. filter: none;
  82. }
  83. #appmenu.inverted svg {
  84. filter: invert(1);
  85. }
  86. }
  87. /* Colorized svg images */
  88. .icon-file, .icon-filetype-text {
  89. background-image: url(./img/core/filetypes/text.svg?v=#{$theming-cachebuster});
  90. }
  91. .icon-folder, .icon-filetype-folder {
  92. background-image: url(./img/core/filetypes/folder.svg?v=#{$theming-cachebuster});
  93. }
  94. .icon-filetype-folder-drag-accept {
  95. background-image: url(./img/core/filetypes/folder-drag-accept.svg?v=#{$theming-cachebuster}) !important;
  96. }
  97. #theming-preview-logo,
  98. #header .logo {
  99. background-image: $image-logo;
  100. }
  101. /* override styles for login screen in guest.css */
  102. @if ($has-custom-logo) {
  103. // custom logo
  104. #theming-preview-logo,
  105. #header .logo {
  106. background-size: contain;
  107. }
  108. #body-login #header .logo {
  109. margin-bottom: 22px;
  110. }
  111. } @else {
  112. // default logo
  113. @if ($invert) {
  114. #theming-preview-logo,
  115. #header .logo {
  116. opacity: .6;
  117. }
  118. }
  119. }
  120. @if variable_exists('theming-background-mime') and $theming-background-mime != '' {
  121. #body-login,
  122. #firstrunwizard .firstrunwizard-header,
  123. #theming-preview {
  124. background-image: $image-login-background;
  125. background-color: $color-primary;
  126. }
  127. } @else {
  128. #theming-preview {
  129. background-image: $image-login-background;
  130. background-color: $color-primary;
  131. }
  132. }
  133. @if variable_exists('theming-logoheader-mime') and $theming-logoheader-mime != '' {
  134. #theming .advanced-option-logoheader .image-preview,
  135. body:not(#body-login) #header .logo {
  136. background-image: url(#{$image-logoheader});
  137. }
  138. } @else {
  139. #theming .advanced-option-favicon .image-preview {
  140. background-image: none;
  141. }
  142. }
  143. @if variable_exists('theming-favicon-mime') and $theming-favicon-mime != '' {
  144. #theming .advanced-option-favicon .image-preview {
  145. background-image: url(#{$image-favicon});
  146. }
  147. } @else {
  148. #theming .advanced-option-favicon .image-preview {
  149. background-image: none;
  150. }
  151. }
  152. input.primary,
  153. #alternative-logins li a {
  154. background-color: $color-primary-element;
  155. border: 1px solid $color-primary-text;
  156. color: $color-primary-text;
  157. }
  158. @if ($invert) {
  159. #body-login {
  160. .body-login-container {
  161. background-color: $color-main-background;
  162. }
  163. #submit-wrapper .icon-confirm-white {
  164. background-image: url('../../../core/img/actions/confirm.svg');
  165. }
  166. .body-login-container {
  167. h2 {
  168. color: $color-main-text;
  169. }
  170. .icon-search.icon-white {
  171. // CSS variable is not used here since it is on the public page layout,
  172. // where the dark theme doesn't apply at the moment
  173. background-image: url('../../../core/img/actions/search.svg');
  174. }
  175. }
  176. }
  177. #body-public #header .icon-more-white {
  178. background-image: var(--icon-more-000);
  179. }
  180. }
  181. // plain background color for login page
  182. @if $image-login-plain == 'true' {
  183. #body-login, #firstrunwizard .firstrunwizard-header, #theming-preview {
  184. background-image: none !important;
  185. background-color: $color-primary;
  186. }
  187. #body-login {
  188. a, label, p {
  189. color: $color-primary-text;
  190. }
  191. }
  192. } @else {
  193. #body-login {
  194. background-color: $color-primary;
  195. }
  196. }
  197. /** Handle primary buttons for bright colors */
  198. @if (luma($color-primary) > 0.8) {
  199. select,
  200. button, .button,
  201. input:not([type='range']),
  202. textarea,
  203. div[contenteditable=true],
  204. .pager li a {
  205. &.primary:not(:disabled) {
  206. background-color: var(--color-background-dark);
  207. color: var(--color-main-text);
  208. border-color: var(--color-text-lighter);
  209. &:hover, &:focus, &:active {
  210. background-color: var(--color-background-darker);
  211. color: var(--color-main-text);
  212. border-color: var(--color-text);
  213. }
  214. }
  215. }
  216. }
  217. @if ($color-primary == #ffffff) {
  218. /* show grey border below header */
  219. #body-user #header,
  220. #body-settings #header,
  221. #body-public #header {
  222. border-bottom: 1px solid #ebebeb;
  223. }
  224. /* show triangle in header in grey */
  225. #appmenu li a.active:before,
  226. .header-right #settings #expand:before {
  227. border-bottom-color:#ebebeb;
  228. }
  229. /* show border around quota bar in files app */
  230. .app-files #quota .quota-container {
  231. border: 1px solid #ebebeb;
  232. }
  233. }
  234. @if ($has-legal-links == 'true') {
  235. footer {
  236. height: 92px;
  237. }
  238. }