Skip to content

Commit 0d825c3

Browse files
Merge pull request #14883 from nextcloud/bugfix/14156/checkboxes-light-theme
Fix light theme form elements
2 parents 87fbaf5 + 798b2e8 commit 0d825c3

File tree

7 files changed

+40
-7
lines changed

7 files changed

+40
-7
lines changed

apps/accessibility/css/themedark.scss

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,3 +74,15 @@ $color-border-dark: lighten($color-main-background, 14%);
7474
filter: invert(100%);
7575
}
7676
}
77+
78+
input[type=checkbox] {
79+
&.checkbox {
80+
&:checked + label:before {
81+
background-image: url('../../../core/img/actions/checkbox-mark-dark.svg');
82+
}
83+
84+
&:indeterminate + label:before {
85+
background-image: url('../../../core/img/actions/checkbox-mixed-dark.svg');
86+
}
87+
}
88+
}

apps/theming/css/theming.scss

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -84,10 +84,6 @@ $invert: luma($color-primary) > 0.6;
8484
@include icon-color('checkbox-mark', 'actions', $color-white, 1, true);
8585
}
8686
}
87-
/* Always give primary button a border for light primary colors */
88-
.primary {
89-
border-color: $color-border !important;
90-
}
9187
} @else {
9288
#appmenu:not(.inverted) svg {
9389
filter: none;
@@ -203,6 +199,29 @@ input.primary,
203199
}
204200
}
205201

202+
/** Handle primary buttons for bright colors */
203+
@if (luma($color-primary) > 0.8) {
204+
select,
205+
button, .button,
206+
input:not([type='range']),
207+
textarea,
208+
div[contenteditable=true],
209+
.pager li a {
210+
&.primary:not(:disabled) {
211+
background-color: var(--color-background-dark);
212+
color: var(--color-main-text);
213+
border-color: var(--color-text-lighter);
214+
215+
&:hover, &:focus, &:active {
216+
background-color: var(--color-background-darker);
217+
color: var(--color-main-text);
218+
border-color: var(--color-text);
219+
}
220+
}
221+
}
222+
223+
}
224+
206225
@if ($color-primary == #ffffff) {
207226
/* show grey border below header */
208227
#body-user #header,

apps/theming/lib/Util.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ public function invertTextColor($color) {
7979
public function elementColor($color) {
8080
$l = $this->calculateLuminance($color);
8181
if($l>0.8) {
82-
return '#dddddd';
82+
return '#aaaaaa';
8383
}
8484
return $color;
8585
}

apps/theming/tests/CapabilitiesTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ public function dataGetCapabilities() {
7474
'slogan' => 'slogan',
7575
'color' => '#FFFFFF',
7676
'color-text' => '#000000',
77-
'color-element' => '#dddddd',
77+
'color-element' => '#aaaaaa',
7878
'logo' => 'http://absolute/logo',
7979
'background' => 'http://absolute/background',
8080
'background-plain' => false,

apps/theming/tests/UtilTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ public function testElementColorDefault() {
105105

106106
public function testElementColorOnBrightBackground() {
107107
$elementColor = $this->util->elementColor('#ffffff');
108-
$this->assertEquals('#dddddd', $elementColor);
108+
$this->assertEquals('#aaaaaa', $elementColor);
109109
}
110110

111111
public function testGenerateRadioButtonWhite() {
Lines changed: 1 addition & 0 deletions
Loading
Lines changed: 1 addition & 0 deletions
Loading

0 commit comments

Comments
 (0)