Skip to content

Commit

Permalink
Merge pull request #93 from discoverfinancial/init
Browse files Browse the repository at this point in the history
Issue 500: Fix for hotlinkOnTertiary
  • Loading branch information
smithbk authored Sep 8, 2023
2 parents e261639 + da77ec3 commit 73e4afe
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion src/atoms/hotlinks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ export class Hotlinks extends Atom {
// Use the dark primary 700 shade in dark mode
primary = primary.getMode()?.color.dark.shades[7];
}
const onTertiary = this.getHotlinkModeVariables("onTertiary", shade, primary.getOnShade2(lm), underline, lm);
const onTertiary = this.getHotlinkModeVariables("onTertiary", shade, primary, underline, lm);
if (!def) {
log.debug(`Hotlinks.getHotlinkVariables exit (onBlack variables not set)`)
return undefined;
Expand All @@ -138,6 +138,7 @@ export class Hotlinks extends Atom {
} else {
onGradient3 = this.getOnGradient3(def, 24, Shade.WHITE_DM, Shade.HALF_WHITE_DM);
}
onTertiary.unvisited.shade = onTertiary.visited.shade = shade.getOnShade2(lm);
this.variables = { default: def, onWhite, onBlack, onTertiary, onGradient3 };
return this.variables;
}
Expand All @@ -157,6 +158,22 @@ export class Hotlinks extends Atom {
}

private getHotlinkModeVariables(type: string, shade: Shade, background: Shade, underline: boolean, lm: boolean): HotlinkModeVariables {
if (type === "onTertiary") {
return {
unvisited: {
shade: shade.getOnShade2(lm),
decoration: "underline",
hoverDecoration: "none",
},
visited: {
shade: shade.getOnShade2(lm).setOpacity(0.7),
decoration: "underline",
hoverDecoration: "none",
},
underline,
underlineRequired: true,
};
}
const onBackground = background.getOnShade2(lm);
let shade1:Shade | undefined;
let shade2:Shade | undefined;
Expand Down

0 comments on commit 73e4afe

Please sign in to comment.