Skip to content

Commit

Permalink
[EuiLink] Remove unnecessary style exports
Browse files Browse the repository at this point in the history
- not being used anywhere in EUI or KIbana, just inline them

+ move internal `_colorCSS` util to bottom of file
  • Loading branch information
cee-chen committed Feb 23, 2024
1 parent 21e68b0 commit 8753ca1
Showing 1 changed file with 13 additions and 25 deletions.
38 changes: 13 additions & 25 deletions src/components/link/link.styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,42 +10,20 @@ import { css } from '@emotion/react';
import { UseEuiTheme } from '../../services';
import { euiFocusRing, logicalTextAlignCSS } from '../../global_styling';

const _colorCSS = (color: string) => {
return `
color: ${color};
&:target {
color: darken(${color}, 10%);
}
`;
};

export const euiLinkHoverCSS = () => {
return `
text-decoration: underline;
`;
};

export const euiLinkFocusCSS = (euiTheme: UseEuiTheme['euiTheme']) => {
return `
text-decoration: underline;
text-decoration-thickness: ${euiTheme.border.width.thick};
`;
};

export const euiLinkCSS = (euiThemeContext: UseEuiTheme) => {
const { euiTheme } = euiThemeContext;
return `
font-weight: ${euiTheme.font.weight.medium};
${logicalTextAlignCSS('left')}
&:hover {
${euiLinkHoverCSS()}
text-decoration: underline;
}
&:focus {
${euiFocusRing(euiThemeContext, 'outset')}
${euiLinkFocusCSS(euiTheme)}
text-decoration: underline;
text-decoration-thickness: ${euiTheme.border.width.thick};
}
`;
};
Expand Down Expand Up @@ -85,3 +63,13 @@ export const euiLinkStyles = (euiThemeContext: UseEuiTheme) => {
text: css(_colorCSS(euiTheme.colors.text)),
};
};

const _colorCSS = (color: string) => {
return `
color: ${color};
&:target {
color: darken(${color}, 10%);
}
`;
};

0 comments on commit 8753ca1

Please sign in to comment.