feat: add Link component with hover and active states
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
@use '../../styles/tokens/typography' as *;
|
||||
|
||||
.link {
|
||||
text-decoration: none;
|
||||
color: var(--nds-primary);
|
||||
@include text-base;
|
||||
&:hover {
|
||||
color: var(--nds-text);
|
||||
opacity: 0.25;
|
||||
}
|
||||
&:active {
|
||||
color: var(--nds-text);
|
||||
opacity: 0.25;
|
||||
}
|
||||
&__container {
|
||||
width: fit-content;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
border-bottom: var(--nds-border-width-medium) dashed var(--nds-secondary);
|
||||
&:hover {
|
||||
background-color: var(--nds-secondary);
|
||||
border-bottom: var(--nds-border-width-medium) dashed var(--nds-accent);
|
||||
}
|
||||
&:active {
|
||||
background-color: var(--nds-primary);
|
||||
border-bottom: var(--nds-border-width-medium) dashed var(--nds-secondary);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
---
|
||||
export interface Props {
|
||||
url: string;
|
||||
blank?: boolean;
|
||||
}
|
||||
const { url, blank } = Astro.props;
|
||||
---
|
||||
<div class='link__container'>
|
||||
<a href={url} class='link' { ...(blank && { target: '_blank', rel: 'noopener noreferrer' }) }>
|
||||
<slot/>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<style lang="scss">
|
||||
@use './link';
|
||||
</style>
|
||||
@@ -6,4 +6,5 @@ export { default as Toggle } from './Toggle/toggle.astro';
|
||||
export { default as Tab } from './Tabs/tab.astro';
|
||||
export { default as TabItem } from './Tabs/tabItem.astro';
|
||||
export { default as TabContent } from './Tabs/tabContent.astro';
|
||||
export { default as Button } from './Button/button.astro';
|
||||
export { default as Button } from './Button/button.astro';
|
||||
export { default as Link } from './Link/link.astro';
|
||||
Reference in New Issue
Block a user