Skip to content

Commit

Permalink
Merge pull request #41920 from nextcloud/backport/41855/stable28
Browse files Browse the repository at this point in the history
[stable28] fix(theming): Fix color inverted icons based on theming and dark mode
  • Loading branch information
szaimen authored Nov 30, 2023
2 parents a1434af + 32ec76e commit 0561b11
Show file tree
Hide file tree
Showing 13 changed files with 31 additions and 10 deletions.
4 changes: 4 additions & 0 deletions apps/files/src/views/Navigation.vue
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,10 @@ export default {
background-position: center;
}

.app-navigation::v-deep .app-navigation-entry.active .button-vue.icon-collapse:not(:hover) {
color: var(--color-primary-element-text);
}

.app-navigation > ul.app-navigation__list {
// Use flex gap value for more elegant spacing
padding-bottom: var(--default-grid-baseline, 4px);
Expand Down
1 change: 1 addition & 0 deletions apps/theming/css/default.css
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@
--background-invert-if-bright: invert(100%);
--background-image-invert-if-bright: no;
--primary-invert-if-bright: no;
--primary-invert-if-dark: invert(100%);
--color-primary: #00679e;
--color-primary-default: #0082c9;
--color-primary-text: #ffffff;
Expand Down
1 change: 1 addition & 0 deletions apps/theming/lib/Themes/CommonThemeTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ protected function generatePrimaryVariables(string $colorMainBackground, string
// invalid one with no fallback. 'unset' could here fallback to some
// other theme with media queries
'--primary-invert-if-bright' => $this->util->invertTextColor($this->primaryColor) ? 'invert(100%)' : 'no',
'--primary-invert-if-dark' => $this->util->invertTextColor($this->primaryColor) ? 'no' : 'invert(100%)',

'--color-primary' => $this->primaryColor,
'--color-primary-default' => $this->defaultPrimaryColor,
Expand Down
2 changes: 1 addition & 1 deletion core/css/apps.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion core/css/apps.css.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions core/css/apps.scss
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,10 @@ kbd {
> a {
background-color: var(--color-primary-element);
color: var(--color-primary-element-text);

&:first-child > img {
filter: var(--primary-invert-if-dark);
}
}
}

Expand Down Expand Up @@ -281,6 +285,9 @@ kbd {
> a {
border-radius: var(--border-radius-pill);
background-color: var(--color-primary-element-light);
&:first-child > img {
filter: var(--primary-invert-if-dark);
}
}
}

Expand Down
2 changes: 1 addition & 1 deletion core/css/server.css

Large diffs are not rendered by default.

Loading

0 comments on commit 0561b11

Please sign in to comment.