kidonng / unocss-preset-daisy

UnoCSS preset for daisyUI
https://unocss-preset-daisy.vercel.app
MIT License
228 stars 19 forks source link

Updated to support the latest version of daisyui and cjs & esm. #38

Closed LeekJay closed 10 months ago

Avaray commented 10 months ago

Wow, this is happening!

gorango commented 10 months ago

Thank you for making progress on this! It's hard to tell what's actually changed, since every file has been updated with new formatting rules - is this intentional? (PS the cool thing about tabs is that everyone can change the indent size inside the editor)

LeekJay commented 10 months ago

Thank you for making progress on this! It's hard to tell what's actually changed, since every file has been updated with new formatting rules - is this intentional? (PS the cool thing about tabs is that everyone can change the indent size inside the editor)

Thanks for your reminder! I should resubmit the PR following the previous formatting rules.

gorango commented 10 months ago

@LeekJay FWIW I'm not a maintainer on the project, and maintenance seems to have slowed - I was just really curious what updates were necessary for migrating to v4.

Again, thank you for all the work on this PR and thank you for your quick response to my comment! <3

Avaray commented 9 months ago

@LeekJay Hope you will continue your work, because it seems nobody is interested in that, except you 😅 And I believe I'm not the only one waiting impatiently for DaisyUI V4 support in UnoCSS.

LeekJay commented 9 months ago

@LeekJay Hope you will continue your work, because it seems nobody is interested in that, except you 😅 And I believe I'm not the only one waiting impatiently for DaisyUI V4 support in UnoCSS.

I found an unocss-preset that had better support for daisyui, but found that maintenance seemed to have slowed down as well. I've slightly updated it. You can git clone this repo and use pnpm-workspace to use it. Details can be found at: https://github.com/LeekJay/unocss-preset-daisyui

gorango commented 9 months ago

@LeekJay thank you!! Do you want to open up issues or discussions on your repo to continue the conversation there?

There are only two issues that are still remaining:

LeekJay commented 9 months ago

@gorango I'd be happy to continue the discussion here. I checked the source code of daisyui and found that the two points you mentioned are caused by the problems left over from upgrading to 4.0.

yicone commented 9 months ago

Thank you! I hope see this sooner. I have been trying a lot and finally found the compatible question.

  • The second problem is that the official tried to use var variables to be compatible with clients that do not support oklch, but tailwincss's <alpha-value> only supports variables starting with color values,like oklch(var(--s)/<alpha-value>) hsl(var(--s)/<alpha-value>) lch(var(--s)/<alpha-value>)is feasible, but var(--fallback-s,oklch(var(--s)/<alpha-value>)) is not supported.

This is my temporary fix, splitting var(--fallback-s,oklch(var(--s)/<alpha-value>)) into two parts:

.rating :where(input) {
    background-color: var(--fallback-bc, oklch(var(--bc)));
    opacity: var(--un-bg-opacity);
}
LeekJay commented 9 months ago

@gorango I'd be happy to continue the discussion here. I checked the source code of daisyui and found that the two points you mentioned are caused by the problems left over from upgrading to 4.0.

  • Regarding the first point, you have already mentioned PR.
  • The second problem is that the official tried to use var variables to be compatible with clients that do not support oklch, but tailwincss's <alpha-value> only supports variables starting with color values,like oklch(var(--s)/<alpha-value>) hsl(var(--s)/<alpha-value>) lch(var(--s)/<alpha-value>)is feasible, but var(--fallback-s,oklch(var(--s)/<alpha-value>)) is not supported.

@gorango @yicone This is my fault! I just tested that var(--fallback-s,oklch(var(--s)/<alpha-value>)) is feasible in tailwindcss!

I re-examined the cause of the problem and found that the problem should come from unocss/packages/preset-mini/src/_utils/utilities.ts.

I'll try my best to fix this issue.😁

LeekJay commented 9 months ago

@LeekJay thank you!! Do you want to open up issues or discussions on your repo to continue the conversation there?

There are only two issues that are still remaining:

  • I made a PR in the DaisyUI repo to fix the base theme colors, which will fix the background and color styles that get applied to :root, [data-theme]
  • all of the -opacity- utilities are no longer working (bg-, text-, b-). Using opacity in the full color name works, like bg-primary/50 but bg-primary bg-opacity-50 doesn't work. Unocss colors still work, like bg-blue bg-opacity-50. I'm really not sure where and how to address that...

@gorango Issue has been resolved and made a PR in the UnoCSS repo

gorango commented 9 months ago

@LeekJay Great work hunting that down -- thank you!!

LeekJay commented 9 months ago

@LeekJay thank you!! Do you want to open up issues or discussions on your repo to continue the conversation there? There are only two issues that are still remaining:

  • I made a PR in the DaisyUI repo to fix the base theme colors, which will fix the background and color styles that get applied to :root, [data-theme]
  • all of the -opacity- utilities are no longer working (bg-, text-, b-). Using opacity in the full color name works, like bg-primary/50 but bg-primary bg-opacity-50 doesn't work. Unocss colors still work, like bg-blue bg-opacity-50. I'm really not sure where and how to address that...

@gorango Issue has been resolved and made a PR in the UnoCSS repo

@Avaray @gorango @yicone @svercl We can update UnoCSS v0.58.1 to get support.🎉🎉

SeryiBaran commented 7 months ago

any news?

whoooami commented 5 months ago

err stack.

unocss-preset-daisy@7.0.0 daisyui@4.10.2 unocss@0.58.1

error when starting dev server:
Error: Cannot find module 'daisyui/dist/unstyled.rtl.js'
Require stack:
- node_modules/.pnpm/unocss-preset-daisy@7.0.0_daisyui@4.10.2_unocss@0.58.1/node_modules/unocss-preset-daisy/index.js
    at Module._resolveFilename (node:internal/modules/cjs/loader:1082:15)
    at Function.resolve (node:internal/modules/helpers:127:19)
    at _resolve (node_modules/.pnpm/jiti@1.20.0/node_modules/jiti/dist/jiti.js:1:250334)
    at jiti (node_modules/.pnpm/jiti@1.20.0/node_modules/jiti/dist/jiti.js:1:252917)
unclemin commented 2 months ago

希望你能继续你的工作,因为似乎没有人对此感兴趣,除了你 😅 我相信我不是唯一一个不耐烦地等待 UnoCSS 中 DaisyUI V4 支持的人。

我找到了一个对 daisyui 有更好支持的 unocss-preset,但发现维护似乎也变慢了。我稍微更新了一下。你可以 git clone this repo 并使用 pnpm-workspace 来使用它。详情请见:https://github.com/LeekJay/unocss-preset-daisyui 安装之后unocss一直在触发刷新 510client:223 [vite] hot updated: /__uno.css