Skip to content

Commit

Permalink
fix(icon): Fix icon color references
Browse files Browse the repository at this point in the history
  • Loading branch information
anicholls committed Jun 12, 2020
1 parent 53b7f49 commit 48092a2
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 14 deletions.
10 changes: 5 additions & 5 deletions modules/icon/css/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -193,14 +193,14 @@ All system icon colors will accept colors from the
> Icon color. This will define `data-accent-color` and `data-fill-color`. `data-accent-color` and
> `data-fill-color` will override this property if defined.
Default: `colors.primary.iconStandard`
Default: `iconColors.standard`

#### `data-hover-color`

> Icon color on hover. This will define `data-hover-accent-color` and `data-hover-fill-color`.
> `data-hover-accent-color` and `data-hover-fill-color` will override this property if defined.
Default: `colors.primary.iconHover`
Default: `iconColors.hover`

#### `data-accent-color`

Expand Down Expand Up @@ -253,7 +253,7 @@ Default: `24`
## Default Options

```js
initializeIcons((iconPath = null), (selector = '.wdc-icon'), iconRoot = document);
initializeIcons((iconPath = null), (selector = '.wdc-icon'), (iconRoot = document));
```

## Icon Path
Expand Down Expand Up @@ -288,8 +288,8 @@ initializeIcons(null, '.wdc-custom-icon');

## Scope Icon Injection

Pass a DOM Element to scope where to look for icons. You can use this to narrow the search instead of looking
at the whole document or to target a shadowDOM
Pass a DOM Element to scope where to look for icons. You can use this to narrow the search instead
of looking at the whole document or to target a shadowDOM

```js
initializeIcons(null, '.wdc-icon', myElement);
Expand Down
6 changes: 1 addition & 5 deletions modules/icon/css/lib/canvas-kit-css-icon.js
Original file line number Diff line number Diff line change
Expand Up @@ -196,11 +196,7 @@ function styleSystemIconHovers(selector, iconRoot = document) {

// Style default hovers
colorIconHoverClasses(hoverableSelector, ['.wd-icon-background'], 'transparent');
colorIconHoverClasses(
hoverableSelector,
['.wd-icon-accent', '.wd-icon-fill'],
canvasColors.primary.iconHover
);
colorIconHoverClasses(hoverableSelector, ['.wd-icon-accent', '.wd-icon-fill'], iconColors.hover);

// Style individual hovers
const hoverableSystemIcons = iconRoot.querySelectorAll(hoverableSelector);
Expand Down
4 changes: 2 additions & 2 deletions modules/icon/react/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -208,15 +208,15 @@ Default: `24`
> Icon color. This will define `accent` and `fill`. `accent` and `fill` will override this property
> if defined.
Default: `colors.primary.iconStandard`
Default: `iconColors.standard`

---

#### `colorHover: string`

> Hover color of the icon. This will define `accentHover` and `fillHover`.
Default: `colors.primary.iconHover`
Default: `iconColors.hover`

---

Expand Down
4 changes: 2 additions & 2 deletions modules/icon/react/lib/SystemIcon.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,12 @@ export interface SystemIconStyles {
backgroundHover?: string;
/**
* The color of the SystemIcon. This defines `accent` and `fill`. `color` may be overriden by `accent` and `fill`.
* @default colors.primary.iconStandard
* @default iconColors.standard
*/
color?: string;
/**
* The hover color of the SystemIcon. This defines `accentHover` and `fillHover`. `colorHover` may be overriden by `accentHover` and `fillHover`.
* @default colors.primary.iconHover
* @default iconColors.hover
*/
colorHover?: string;
/**
Expand Down

0 comments on commit 48092a2

Please sign in to comment.