Skip to content

Commit 7f2313a

Browse files
committed
fix(icon): invert icon color for some circle colors
1 parent f0ab802 commit 7f2313a

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

elements/pfe-icon/pfe-icon.scss

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,10 @@ $sizing: (
150150
}
151151
}
152152

153+
:host([color="#{$color}"][circled]) {
154+
--pfe-icon--color: white;
155+
}
156+
153157

154158
/* Override circled items with color set to named property */
155159
:host([color=#{$color}][circled]:not([circled="false"])) {

elements/pfe-icon/pfe-icon.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { LitElement, html, svg } from 'lit';
44
import { customElement, property, query, state } from 'lit/decorators.js';
55
import { styleMap } from 'lit/directives/style-map.js';
66

7-
import { pfelement, bound, observed } from '@patternfly/pfe-core/decorators.js';
7+
import { pfelement, bound, observed, colorContextConsumer } from '@patternfly/pfe-core/decorators.js';
88
import { getRandomId } from '@patternfly/pfe-core/functions/random.js';
99
import { Logger } from '@patternfly/pfe-core/controllers/logger.js';
1010

@@ -13,6 +13,7 @@ import { PfeIconSet } from './icon-set.js';
1313
import { addBuiltIns } from './builtin-icon-sets.js';
1414

1515
import style from './pfe-icon.scss';
16+
import { ColorTheme } from '@patternfly/pfe-core';
1617

1718
export type IconColor = (
1819
| 'accent'
@@ -141,6 +142,12 @@ export class PfeIcon extends LitElement {
141142

142143
@property({ type: Boolean, reflect: true }) block = false;
143144

145+
/**
146+
* Sets color theme based on parent context
147+
*/
148+
@colorContextConsumer()
149+
@property({ reflect: true }) on?: ColorTheme;
150+
144151
@state() private _iconHref = '';
145152

146153
@state() private _filterId?: string;

0 commit comments

Comments
 (0)