ui icon indicating copy to clipboard operation
ui copied to clipboard

Select and TextArea components duplicated border classes

Open alonsourena opened this issue 2 years ago • 1 comments

Hi, I love the new update, it's awesome ❤️

I found that the border-neutral-200 and dark:border-neutral-800 classes on the select.tsx component are duplicated.

I'm using "cssVariables": false.

image image

alonsourena avatar Jun 24 '23 05:06 alonsourena

The duplicate class is caused by this:

https://github.com/shadcn/ui/blob/aea12e97623699e7c7b2d75fc671ea21b0cf8887/packages/cli/src/utils/transformers/transform-css-vars.ts#L143-L145

When a component has the border class it gets replaced with border border-border and, since the select has already border-input this brings two border color classes when the colors are resolved.

List of affected components:

  • select
  • textarea
  • radio-group
  • alert (destructive variant)
  • checkbox
  • input

dan5py avatar Jun 24 '23 10:06 dan5py

I encountered this issue with the radio-group and checkbox components today.

On the Checkbox component I get border-gray-200 border-gray-900 and dark:border-gray-50 dark:border-gray-800.

On the RadioGroupItem component I get border-gray-200 border-gray-900 and dark:border-gray-50 dark:border-gray-800.

I am using the latest tag for the cli command.

My components.json is

{
  "$schema": "https://ui.shadcn.com/schema.json",
  "style": "default",
  "rsc": true,
  "tsx": true,
  "tailwind": {
    "config": "tailwind.config.js",
    "css": "src/styles/globals.css",
    "baseColor": "gray",
    "cssVariables": false,
    "prefix": ""
  },
  "aliases": {
    "components": "@/components",
    "utils": "@/lib/utils"
  }
}

EDIT: I am blind. There is another issue link right above.

Cielquan avatar Jan 25 '24 12:01 Cielquan