Skip to content

Commit

Permalink
feat(link): add textUnderlineOffset to Link component theme override
Browse files Browse the repository at this point in the history
  • Loading branch information
igera93 authored and HerrTopi committed Dec 10, 2024
1 parent 3bd4c99 commit 2b2a997
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions packages/shared-types/src/ComponentThemeVariables.ts
Original file line number Diff line number Diff line change
Expand Up @@ -653,6 +653,7 @@ export type LinkTheme = {
focusInverseIconOutlineColor: Colors['contrasts']['white1010']
iconSize: string
iconPlusTextMargin: Spacing['xxSmall']
textUnderlineOffset: string
}

export type InlineListItemTheme = {
Expand Down
1 change: 1 addition & 0 deletions packages/ui-link/src/Link/styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ const generateStyle = (
outlineStyle: componentTheme.focusOutlineStyle,
borderRadius: componentTheme.focusOutlineBorderRadius,
outlineOffset: '0.25rem',
textUnderlineOffset: componentTheme.textUnderlineOffset,

// If TruncateText is used in Link with icon, align the icon and the text vertically
...(renderIcon &&
Expand Down
3 changes: 2 additions & 1 deletion packages/ui-link/src/Link/theme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,8 @@ const generateComponentTheme = (theme: Theme): LinkTheme => {
focusInverseIconOutlineColor: colors?.contrasts?.white1010,

iconSize: '1.125em', // make icon slightly larger than inherited font-size,
iconPlusTextMargin: spacing?.xxSmall
iconPlusTextMargin: spacing?.xxSmall,
textUnderlineOffset: 'auto'
}

return {
Expand Down

0 comments on commit 2b2a997

Please sign in to comment.