Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(link): add textUnderlineOffset to Link component theme override #1817

Merged
merged 1 commit into from
Dec 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading