Skip to content

Commit d16e546

Browse files
committed
feat(Link): migrate to semantic colors
1 parent ae68790 commit d16e546

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/components/Link/Link.tsx

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { ComponentPropsWithoutRef } from 'react';
22
import styled from 'styled-components';
33
import { compose, fontSize, FontSizeProps, margin, MarginProps, textAlign, TextAlignProps } from 'styled-system';
4-
import { Colors } from '../../essentials';
4+
import { getSemanticValue } from '../../utils/cssVariables';
55
import { theme } from '../../essentials/theme';
66
import { get } from '../../utils/themeGet';
77

@@ -14,7 +14,7 @@ interface LinkProps extends ComponentPropsWithoutRef<'a'>, MarginProps, FontSize
1414

1515
const Link = styled.a.attrs({ theme })<LinkProps>`
1616
display: inline-block;
17-
color: ${p => (p.inverted ? Colors.WHITE : Colors.ACTION_BLUE_900)};
17+
color: ${p => getSemanticValue(p.inverted ? 'text-linkInverted' : 'text-link')};
1818
cursor: pointer;
1919
line-height: 1.4;
2020
font-family: ${get('fonts.normal')};
@@ -24,12 +24,12 @@ const Link = styled.a.attrs({ theme })<LinkProps>`
2424
2525
&:link,
2626
&:visited {
27-
color: ${p => (p.inverted ? Colors.WHITE : Colors.ACTION_BLUE_900)};
27+
color: ${p => getSemanticValue(p.inverted ? 'text-linkInverted' : 'text-link')};
2828
}
2929
3030
&:hover,
3131
&:active {
32-
color: ${p => (p.inverted ? Colors.AUTHENTIC_BLUE_350 : Colors.ACTION_BLUE_1000)};
32+
color: ${p => getSemanticValue(p.inverted ? 'text-linkHoverInverted' : 'text-linkHover')};
3333
text-decoration: underline;
3434
}
3535

src/essentials/Colors/Colors.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ export const SemanticColors = {
6868
link: Colors.blue.secondary[900],
6969
linkInverted: Colors.white,
7070
linkHover: Colors.blue.secondary[1000],
71-
linkHoverInverted: Colors.blue.secondary[50],
71+
linkHoverInverted: Colors.blue.secondary[150],
7272
danger: Colors.orange[1000],
7373
dangerInverted: Colors.orange[900],
7474
success: Colors.green[1000],

0 commit comments

Comments
 (0)