Skip to content

Commit

Permalink
Removed accent fill direction to standardize foreground color (#18789)
Browse files Browse the repository at this point in the history
  • Loading branch information
bheston authored and chrisdholt committed Jul 2, 2021
1 parent ef7938d commit e65c4a2
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "patch",
"comment": "Removed accent fill direction handling to standardize foreground text color",
"packageName": "@fluentui/web-components",
"email": "[email protected]",
"dependentChangeType": "patch"
}
8 changes: 3 additions & 5 deletions packages/web-components/src/color/recipes/accent-fill.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,11 @@ export function accentFill(
neutralFillActiveDelta: number,
): InteractiveSwatchSet {
const accent = palette.source;
const referenceIndex = neutralPalette.closestIndexOf(reference);
const swapThreshold = Math.max(neutralFillRestDelta, neutralFillHoverDelta, neutralFillActiveDelta);
const direction = referenceIndex >= swapThreshold ? -1 : 1;
const direction = 1;
const accentIndex = palette.closestIndexOf(accent);

const hoverIndex = accentIndex;
const restIndex = hoverIndex + direction * -1 * hoverDelta;
const restIndex = accentIndex;
const hoverIndex = restIndex + direction * hoverDelta;
const activeIndex = restIndex + direction * activeDelta;
const focusIndex = restIndex + direction * focusDelta;

Expand Down

0 comments on commit e65c4a2

Please sign in to comment.