tailwindcss-radix-colors icon indicating copy to clipboard operation
tailwindcss-radix-colors copied to clipboard

Option to have only semantic classes

Open f15u opened this issue 9 months ago • 1 comments

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.

f15u avatar May 15 '24 21:05 f15u