Skip to content

Commit

Permalink
MOBILE-4362 icon: Improve icon filter handling
Browse files Browse the repository at this point in the history
  • Loading branch information
crazyserver committed Oct 25, 2023
1 parent 993dc19 commit 68d9d6c
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 15 deletions.
Original file line number Diff line number Diff line change
@@ -1,13 +1,7 @@
:host {
--mod-icon-filter: brightness(0);

core-mod-icon {
background: transparent;
margin: 0;
--filter: var(--mod-icon-filter);
--filter: var(--module-icon-filter);
}
}

:host-context(html.dark) {
--mod-icon-filter: brightness(0) invert(1);
}
3 changes: 1 addition & 2 deletions src/core/components/mod-icon/mod-icon.scss
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
--icon-radius: var(--module-icon-radius, var(--radius-xs));
--margin-end: 0px;
--margin-vertical: 0px;
--filter: brightness(0) invert(1);

margin-top: var(--margin-vertical);
margin-bottom: var(--margin-vertical);
Expand All @@ -22,7 +21,7 @@
&.#{$type} {
background-color: var(--activity#{$type});
img {
filter: var(--filter);
filter: var(--filter, brightness(0) invert(1));
}
}
}
Expand Down
4 changes: 1 addition & 3 deletions src/core/features/grades/pages/course/course.scss
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
--even-cell-hover: var(--light);
--icon-color: var(--gray-500);
--border-color: var(--stroke);
--mod-icon-filter: brightness(0);

.odd {
--cell-background: var(--odd-cell-background);
Expand All @@ -29,7 +28,6 @@
--even-cell-background: var(--gray-900);
--even-cell-hover: var(--gray-700);
--icon-color: var(--gray-200);
--mod-icon-filter: brightness(0) invert(1);
}

.core-grades-table {
Expand Down Expand Up @@ -89,7 +87,7 @@
--padding: 0px;
--size: 16px;
background: transparent;
--filter: var(--mod-icon-filter);
--filter: var(--module-icon-filter);
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
--core-global-search-result-content-color: var(--gray-700);
--core-global-search-result-context-color: var(--gray-600);
--core-global-search-result-icon-size: 16px;
--mod-icon-filter: brightness(0);

h3 {
font-size: 16px;
Expand All @@ -14,7 +13,7 @@

core-mod-icon {
--size: var(--core-global-search-result-icon-size);
--filter: var(--mod-icon-filter);
--filter: var(--module-icon-filter);

margin-inline-end: var(--spacing-2);
margin-top: 0px;
Expand Down Expand Up @@ -101,5 +100,4 @@
:host-context(html.dark) ion-item {
--core-global-search-result-content-color: var(--gray-400);
--core-global-search-result-context-color: var(--gray-500);
--mod-icon-filter: brightness(0) invert(1);
}
2 changes: 2 additions & 0 deletions src/theme/theme.dark.scss
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,8 @@ html.dark {
--core-login-input-background: var(--core-login-background);
--core-login-input-color: var(--core-login-text-color);

--module-icon-filter: brightness(0) invert(1);

--core-question-correct-color: var(--success-tint);
--core-question-correct-color-bg: var(--success-shade);
--core-question-incorrect-color: var(--danger);
Expand Down
2 changes: 2 additions & 0 deletions src/theme/theme.light.scss
Original file line number Diff line number Diff line change
Expand Up @@ -352,6 +352,8 @@ html {
--core-messages-discussion-badge: var(--primary);
--core-messages-discussion-badge-text: var(--white);

--module-icon-filter: brightness(0);

--addon-forum-avatar-size: var(--core-avatar-size);
--addon-forum-border-color: var(--stroke);
--addon-forum-highlight-color: var(--light);
Expand Down

0 comments on commit 68d9d6c

Please sign in to comment.