Skip to content

Commit

Permalink
feat(Slimscroll): config redesign and implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
driss-chelouati committed Dec 8, 2023
1 parent a05f94f commit 1106e12
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
5 changes: 3 additions & 2 deletions src/plugins/components/slimscroll/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,16 @@ export default plugin.withOptions(
[`@apply w-${config.width}`]: {},
},
[`.${prefix}slimscroll::-webkit-scrollbar-thumb`]: {
[`@apply rounded-lg bg-${config.bg} dark:bg-${config.bgDark} duration-300 transition-all`]:
[`@apply rounded-lg bg-${config.background.base.light} dark:bg-${config.background.base.dark} duration-300 transition-all`]:
{},
},
[`.${prefix}slimscroll-opaque::-webkit-scrollbar-thumb`]: {
[`@apply rounded-lg bg-transparent duration-300 transition-all`]: {},
},
[`.${prefix}slimscroll:hover::-webkit-scrollbar-thumb, .${prefix}slimscroll-opaque:hover::-webkit-scrollbar-thumb`]:
{
[`@apply bg-${config.bgHover} dark:bg-${config.bgHoverDark}`]: {},
[`@apply bg-${config.background.hover.light} dark:bg-${config.background.hover.dark}`]:
{},
},
})
}
Expand Down
14 changes: 10 additions & 4 deletions src/plugins/components/slimscroll/slimscroll.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,16 @@ export const key = 'slimscroll' as const

export const defaultConfig = {
width: '[6px]',
bg: 'black/5',
bgDark: 'white/5',
bgHover: 'black/20',
bgHoverDark: 'white/20',
background: {
base: {
light: 'black/5',
dark: 'white/5',
},
hover: {
light: 'black/20',
dark: 'white/20',
},
},
}

export type SlimscrollConfig = typeof defaultConfig
Expand Down

0 comments on commit 1106e12

Please sign in to comment.