aboutsummaryrefslogtreecommitdiffstats
path: root/apps/theming/css/theming.scss
blob: f21f00f438a1f3d757c18fd32742f8c2210a58bd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
/** Calculate luma as it is also used in OCA\Theming\Util::calculateLuma */
@function luma($c) {
	$-local-red: red(rgba($c, 1.0));
	$-local-green: green(rgba($c, 1.0));
	$-local-blue: blue(rgba($c, 1.0));

	@return (0.2126 * $-local-red  + 0.7152 * $-local-green + 0.0722 * $-local-blue) / 255;
}

$has-custom-logo: variable_exists('theming-logo-mime') and $theming-logo-mime != '';
$invert: luma($color-primary) > 0.6;

@if ($has-custom-logo == false) {
	@if ($invert) {
		$image-logo: url(icon-color-path('logo', 'logo', #000000, 1, true));
	} @else {
		$image-logo: url(icon-color-path('logo', 'logo', #ffffff, 1, true));
	}
}

.nc-theming-main-background {
	background-color: $color-primary;
}

.nc-theming-main-text {
	color: $color-primary-text;
}

.nc-theming-contrast {
	color: $color-primary-text;
}

@if ($invert) {
	// too bright, use dark text to mix the primary
	$color-primary-light: mix($color-primary, $color-main-text, 10%);

	#appmenu:not(.inverted) svg {
		filter: invert(1);
	}
	#appmenu.inverted svg {
		filter: none;
	}
	.searchbox input[type="search"] {
		background-repeat: no-repeat;
		background-position: 6px center;
		background-color: transparent;
		@include icon-color('search', 'actions', $color-black, 1, true);
	}
	#contactsmenu .icon-contacts {
		@include icon-color('contacts', 'places', $color-black, 1, true);
	}
	#settings .icon-settings-white {
		@include icon-color('settings', 'actions', $color-black, 1, true);
	}
	#appmenu .icon-more-white {
		@include icon-color('more', 'actions', $color-black, 1, true);
	}

	#body-login {

		input,
		#alternative-logins li a {
			border: 1px solid nc-lighten($color-primary-text, 50%);
		}
		input.primary,
		button.primary,
		#alternative-logins li a {
			background-color: $color-primary;
			color: $color-primary-text;
		}
		a,
		label,
		footer p,
		#alternative-logins legend,
		.lost-password-container #lost-password {
			color: $color-primary-text;
		}
		input[type='checkbox'].checkbox--white + label:before {
			border-color: nc-darken($color-primary-element, 40%) !important;
		}
		input[type='checkbox'].checkbox--white:not(:disabled):not(:checked) + label:hover:before,
		input[type='checkbox'].checkbox--white:focus + label:before {
			border-color: nc-darken($color-primary-element, 30%) !important;
		}
		input[type='checkbox'].checkbox--white:checked + label:before {
			border-color: nc-darken($color-primary-element, 30%) !important;
			background-color: nc-darken($color-primary-element, 30%) !important;
			@include icon-color('checkbox-mark', 'actions', $color-white, 1, true);
		}
	}
} @else {
	#appmenu:not(.inverted) svg {
		filter: none;
	}
	#appmenu.inverted svg {
		filter: invert(1);
	}
}

/* Colorized svg images */
.icon-file, .icon-filetype-text {
	background-image: url(./img/core/filetypes/text.svg?v=#{$theming-cachebuster});
}

.icon-folder, .icon-filetype-folder {
	background-image: url(./img/core/filetypes/folder.svg?v=#{$theming-cachebuster});
}

.icon-filetype-folder-drag-accept {
	background-image: url(./img/core/filetypes/folder-drag-accept.svg?v=#{$theming-cachebuster}) !important;
}

#theming-preview-logo,
#header .logo {
	background-image: $image-logo;
}

/* override styles for login screen in guest.css */
@if ($has-custom-logo) {
	// custom logo
	#theming-preview-logo,
	#header .logo {
		background-size: contain;
	}

	#body-login #header .logo {
		margin-bottom: 22px;
	}
} @else {
	// default logo
	@if ($invert) {
		#theming-preview-logo,
		#header .logo {
			opacity: .6;
		}
	}
}

@if variable_exists('theming-background-mime') and $theming-background-mime != ''  {
	#body-login,
	#firstrunwizard .firstrunwizard-header,
	#theming-preview {
		background-image: $image-login-background;
		background-color: $color-primary;
	}
} @else {
	  #theming-preview {
		  background-image: $image-login-background;
		  background-color: $color-primary;
	  }
}

@if variable_exists('theming-logoheader-mime') and $theming-logoheader-mime != '' {
	#theming .advanced-option-logoheader .image-preview,
	body:not(#body-login) #header .logo {
		background-image: url(#{$image-logoheader});
	}
} @else {
	#theming .advanced-option-favicon .image-preview {
		background-image: none;
	}
}

@if variable_exists('theming-favicon-mime') and $theming-favicon-mime != '' {
	#theming .advanced-option-favicon .image-preview {
		background-image: url(#{$image-favicon});
	}
} @else {
	#theming .advanced-option-favicon .image-preview {
		background-image: none;
	}
}

input.primary,
#alternative-logins li a {
	background-color: $color-primary-element;
	border: 1px solid $color-primary-text;
	color: $color-primary-text;
}

@if ($invert) {
	#body-login {
		.body-login-container {
			background-color: $color-main-background;
		}
		#submit-wrapper .icon-confirm-white {
			background-image: url('../../../core/img/actions/confirm.svg');
		}
		.body-login-container {
			h2 {
				color: $color-main-text;
			}
			.icon-search.icon-white {
				// CSS variable is not used here since it is on the public page layout,
				// where the dark theme doesn't apply at the moment
				background-image: url('../../../core/img/actions/search.svg');
			}
		}
	}
	#body-public #header .icon-more-white {
		background-image: var(--icon-more-000);
	}
}

// plain background color for login page
@if $image-login-plain == 'true' {
	#body-login, #firstrunwizard .firstrunwizard-header, #theming-preview {
		background-image: none !important;
		background-color: $color-primary;
	}
	#body-login {

		a, label, p {
			color: $color-primary-text;
		}

	}
} @else {
	#body-login {
		background-color: $color-primary;
	}
}

/** Handle primary buttons for bright colors */
@if (luma($color-primary) > 0.8) {
	select,
	button, .button,
	input:not([type='range']),
	textarea,
	div[contenteditable=true],
	.pager li a {
		&.primary:not(:disabled) {
			background-color: var(--color-background-dark);
			color: var(--color-main-text);
			border-color: var(--color-text-lighter);

			&:hover, &:focus, &:active {
				background-color: var(--color-background-darker);
				color: var(--color-main-text);
				border-color: var(--color-text);
			}
		}
	}

}

@if ($color-primary == #ffffff) {
	/* show grey border below header */
	#body-user #header,
	#body-settings #header,
	#body-public #header {
		border-bottom: 1px solid #ebebeb;
	}

	/* show triangle in header in grey */
	#appmenu li a.active:before,
	.header-right #settings #expand:before {
		border-bottom-color:#ebebeb;
	}

	/* show border around quota bar in files app */
	.app-files #quota .quota-container {
		border: 1px solid #ebebeb;
	}
}

@if ($has-legal-links == 'true') {
	footer {
		height: 92px;
	}
}