endigma / unocss-preset-radix

A preset for UnoCSS to let you use Radix color palette
https://endigma.github.io/unocss-preset-radix/
MIT License
31 stars 6 forks source link

Extend theme will make radix colors unavailable when matching Uno preset is equivalent. #21

Open sannajammeh opened 9 months ago

sannajammeh commented 9 months ago

Right now we only have 2 options, either extend or remove all defaults. The issue is this line:

       ...(extend ? theme.colors : []),

It's applied after adding the radix colors, meaning for colors like mauve, Uno will prefer the default theme colors. I suggest a way to add this at the start, or similarly a way to not only prefix css variables but also prefix the generated color matchers so I can write bg-radix-<color> and keep the default uno colors for themselves.

endigma commented 9 months ago

I'd accept a PR for this, but unfortunately I don't have a lot of time to work on this library at the moment. It's used internally at my company and iterating on it isn't a priority. If you can wait I'll probably get to it soon, but I'd accept a PR that adds a global prefix or somehow fixes the load order.

This solution could also try and resolve #19