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: articles variant added to link component #302

Merged
merged 3 commits into from
Jan 31, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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: 5 additions & 0 deletions packages/components/link/src/link.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,11 @@ export const linkProps = buildProps({
required: false,
default: false,
},
articles: {
type: Boolean,
required: false,
default: false,
},
} as const)

export type LinkProps = ExtractPropTypes<typeof linkProps>
Expand Down
1 change: 1 addition & 0 deletions packages/components/link/src/link.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
'puik-link',
`puik-link--${size}`,
{ 'puik-link--high-contrast': highContrast },
{ 'puik-link--articles': articles },
]"
:data-test="dataTest"
>
Expand Down
11 changes: 10 additions & 1 deletion packages/components/link/stories/link.stories.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,16 @@ export default {
},
highContrast: {
description:
'Sets the link in high contrast mode by disabling the purple color for the visited stated',
'Sets the link in high contrast mode by changing the gray underline color',
table: {
defaultValue: {
summary: false,
},
},
},
articles: {
mattgoud marked this conversation as resolved.
Show resolved Hide resolved
description:
'Sets the link in articles mode, adding the purple color for the visited stated',
table: {
defaultValue: {
summary: false,
Expand Down
5 changes: 5 additions & 0 deletions packages/components/link/test/link.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,9 @@ describe('Link tests', () => {
factory({ highContrast: true })
expect(findLink().classes()).toContain('puik-link--high-contrast')
})

it('should set the link in articles mode', () => {
factory({ articles: true })
expect(findLink().classes()).toContain('puik-link--articles')
})
})
19 changes: 14 additions & 5 deletions packages/theme/src/link.scss
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,15 @@
duration-150;

&:hover,
&:active {
&:active,
&:visited {
@apply decoration-primary underline-offset-[5px];
}

&:focus-visible {
@apply outline-none ring-2 ring-blue rounded-[4px] shadow-none;
}

&:visited {
@apply text-purple-700;
}

&__target__icon {
@apply font-materialIcons align-bottom;

Expand All @@ -52,4 +49,16 @@
}
@apply decoration-primary;
}

&--articles {
@apply decoration-primary-500;

&:visited {
@apply text-purple-700 decoration-primary-500;
}

&:focus-visible {
@apply decoration-primary-800;
}
}
}
Loading