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

💄 Fix styles of links #1910 #1911

Merged
merged 1 commit into from
Sep 29, 2023
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
5 changes: 3 additions & 2 deletions web/components/src/Link/Link.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,11 @@ import { default as NextLink } from 'next/link'

const { outline } = Tokens

export const BaseLink = styled(NextLink)`
export const BaseLink = styled(NextLink)<{ $textDecoration?: string }>`
display: inline-flex;
align-items: center;
color: var(--slate-blue-95);
text-decoration: ${({ $textDecoration }) => $textDecoration || 'none'};
&[data-focus-visible-added]:focus {
${outlineTemplate(outline)}
}
Expand Down Expand Up @@ -144,9 +145,9 @@ export const Link = forwardRef<HTMLAnchorElement, LinkProps>(function Link(
style={
{
...style,
textDecoration: underline ? 'underline' : 'none',
} as CSSProperties
}
$textDecoration={underline ? 'underline' : 'none'}
{...rest}
>
{children} {type === 'externalUrl' ? <Icon data={external_link} size={16} /> : null}
Expand Down
1 change: 0 additions & 1 deletion web/pageComponents/shared/Hero/FiftyFiftyHero.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import TitleText from '../portableText/TitleText'
import type { LinkData, HeroType } from '../../../types/types'
import { BackgroundContainer, Link, Text } from '@components'
import { getUrlFromAction } from '../../../common/helpers/getUrlFromAction'
import { Flags } from '../../../common/helpers/datasetHelpers'
import { getLocaleFromName } from '../../../lib/localization'

const StyledHero = styled(BackgroundContainer)`
Expand Down
4 changes: 3 additions & 1 deletion web/pageComponents/shared/siteMenu/MenuGroup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,9 @@ export const MenuGroup = ({ topLevelItem, index }: MenuGroupType) => {
<SubMenuGroupList aria-label={groupItem.label || topLevelLink?.label} unstyled>
{groupItem.links?.map((link: MenuLinkData) => (
<StyledItem key={link.id}>
<StyledSubMenuGroupLink href={getLink(link)}>{link.label}</StyledSubMenuGroupLink>
<StyledSubMenuGroupLink underline={false} href={getLink(link)}>
{link.label}
</StyledSubMenuGroupLink>
</StyledItem>
))}
</SubMenuGroupList>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,10 @@ const SimpleSiteMenu = ({ data, ...rest }: MenuProps) => {
}
return (
<li key={item.id}>
<MenuLink href={(item.link && item.link.slug) || '/'}> {item.label} </MenuLink>
<MenuLink variant="contentLink" href={(item.link && item.link.slug) || '/'}>
{' '}
{item.label}{' '}
</MenuLink>
</li>
)
}
Expand Down
Loading