Skip to content

Commit

Permalink
Removed accent fill direction handling to standardize foreground text…
Browse files Browse the repository at this point in the history
… color
  • Loading branch information
bheston committed Jun 30, 2021
1 parent 107705c commit a5c5cf8
Showing 1 changed file with 3 additions and 5 deletions.
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 a5c5cf8

Please sign in to comment.