From e65c4a26295eb84f59a86bab78dacee59ec2044a Mon Sep 17 00:00:00 2001 From: Brian Heston <47367562+bheston@users.noreply.github.com> Date: Wed, 30 Jun 2021 17:15:40 -0700 Subject: [PATCH] Removed accent fill direction to standardize foreground color (#18789) --- ...b-components-f81d3aa5-c0aa-46c6-972f-774e69c15d79.json | 7 +++++++ packages/web-components/src/color/recipes/accent-fill.ts | 8 +++----- 2 files changed, 10 insertions(+), 5 deletions(-) create mode 100644 change/@fluentui-web-components-f81d3aa5-c0aa-46c6-972f-774e69c15d79.json diff --git a/change/@fluentui-web-components-f81d3aa5-c0aa-46c6-972f-774e69c15d79.json b/change/@fluentui-web-components-f81d3aa5-c0aa-46c6-972f-774e69c15d79.json new file mode 100644 index 0000000000000..5bf9f3fbc44d8 --- /dev/null +++ b/change/@fluentui-web-components-f81d3aa5-c0aa-46c6-972f-774e69c15d79.json @@ -0,0 +1,7 @@ +{ + "type": "patch", + "comment": "Removed accent fill direction handling to standardize foreground text color", + "packageName": "@fluentui/web-components", + "email": "47367562+bheston@users.noreply.github.com", + "dependentChangeType": "patch" +} diff --git a/packages/web-components/src/color/recipes/accent-fill.ts b/packages/web-components/src/color/recipes/accent-fill.ts index dae18c6a99546..ea99179bf71ea 100644 --- a/packages/web-components/src/color/recipes/accent-fill.ts +++ b/packages/web-components/src/color/recipes/accent-fill.ts @@ -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;