mrcaidev / tailwindcss-radix-colors

A Tailwind CSS plugin that brings Radix UI's color system to Tailwind CSS.
https://tailwindcss-radix-colors.mrcai.dev
MIT License
130 stars 4 forks source link

Option to have only semantic classes #14

Open FedericoBiccheddu opened 1 month ago

FedericoBiccheddu commented 1 month ago

One thing the I like the most about radix ui colors is the ability to have enough flexibility using only the semantic meaning as stated in https://www.radix-ui.com/colors/docs/palette-composition/understanding-the-scale

It think a good addition is having an option to disable the access to the low level color/step.

declare interface TailwindCSSRadixColorsOptions {
    /**
     * Disable the semantics classes, such as `bg-red-solid`.
     * 
+    * @deprecated Use `class: "step"` instead
     */
    disableSemantics?: boolean;

    /**
    * Choose which class `bg-red-solid`.
    * 
    * @default 'both'
    */
+   class?: "semantic" | "step" | "both";
}

Without releasing a major, disableSemantics when used sets class to step, but having class precedence.

If you are interested I can take a look and try to make a PR.

mrcaidev commented 1 month ago

Sounds great.

And for the naming part, I think style would be more appropriate instead of class.

Feel free to make a PR!