unpreset / unocss-preset-scrollbar

Scrollbar for UnoCSS preset.
MIT License
53 stars 3 forks source link

Shortcut utilities are not resolved when prefixed #10

Closed s3dse closed 1 year ago

s3dse commented 1 year ago

My uno.config.js looks like this:

presets: [
  presetUno({ prefix: 'tw-' }), // unfortunately we need to prefix
  presetAttributify(),
  presetScrollbar(),
]

When using the scrollbar classes, uno gives me the following errors:

[unocss] unmatched utility "overflow-auto" in shortcut "scrollbar"
[unocss] unmatched utility "scrollbar-track:bg-[var(--scrollbar-track)]" in shortcut "scrollbar"
[unocss] unmatched utility "scrollbar-thumb:bg-[var(--scrollbar-thumb)]" in shortcut "scrollbar"
[unocss] unmatched utility "scrollbar:w-[var(--scrollbar-width)]" in shortcut "scrollbar"
[unocss] unmatched utility "scrollbar:h-[var(--scrollbar-height)]" in shortcut "scrollbar"
[unocss] unmatched utility "scrollbar-track:rounded-[var(--scrollbar-track-radius)]" in shortcut "scrollbar-rounded"
[unocss] unmatched utility "scrollbar-thumb:rounded-[var(--scrollbar-thumb-radius)]" in shortcut "scrollbar-rounded"

When I remove the prefix for presetUno everything works as expected. I see the shortcuts are defined with the literals of utilities. Is it possible to make them adapt to the prefix of presetUno?

action-hong commented 1 year ago

upgrade to lastest and check @s3dse

https://stackblitz.com/edit/vitejs-vite-kwfimc

s3dse commented 1 year ago

🎉 It works, thank you so much!