Skip to content

Commit

Permalink
feat(Link): config redesign and implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
driss-chelouati committed Dec 7, 2023
1 parent d6483ce commit 49e8de1
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 6 deletions.
9 changes: 8 additions & 1 deletion src/plugins/components/link/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,14 @@ export default plugin.withOptions(

addComponents({
[`.${prefix}link`]: {
[`@apply font-${config.font} hover:text-${config.textHover} dark:hover:text-${config.textHoverDark} underline-offset-4 hover:underline focus:text-${config.textFocus} dark:focus:text-${config.textFocusDark} focus:underline`]:
//Base
[`@apply font-${config.font.family} underline-offset-4 hover:underline focus:underline`]:
{},
//Hover
[`@apply hover:text-${config.font.color.hover.light} dark:hover:text-${config.font.color.hover.dark}`]:
{},
//Focus
[`@apply focus:text-${config.font.color.focus.light} dark:focus:text-${config.font.color.focus.dark}`]:
{},
},
})
Expand Down
18 changes: 13 additions & 5 deletions src/plugins/components/link/link.config.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,19 @@
export const key = 'link' as const

export const defaultConfig = {
font: 'sans',
textHover: 'primary-500',
textHoverDark: 'primary-400',
textFocus: 'primary-500',
textFocusDark: 'primary-400',
font: {
family: 'sans',
color: {
hover: {
light: 'primary-500',
dark: 'primary-400',
},
focus: {
light: 'primary-500',
dark: 'primary-400',
},
},
},
}

export type LinkPluginConfig = typeof defaultConfig
Expand Down

0 comments on commit 49e8de1

Please sign in to comment.