unovue / shadcn-vue

Vue port of shadcn-ui
https://www.shadcn-vue.com/
MIT License
5.3k stars 316 forks source link

fix: PinInput: Add background-color to fix dark mode #895

Closed Duncank closed 1 week ago

Duncank commented 1 week ago

๐Ÿ”— Linked issue

894

โ“ Type of change

๐Ÿ“š Description

Adds the bg-background class to the Pin-input input fields, which styles it similar to regular Input components, and which fixes the background color in dark mode.

Stackblitz demo without this fix applied

Resolves #894

๐Ÿ“ธ Screenshots (if appropriate)

Before:

image image

After:

image image

๐Ÿ“ Checklist

sadeghbarati commented 1 week ago

PIN Input demo is working fine in the documentation because of

html.dark {
    color-scheme: dark;
}

The main shadcn-ui Input OTP also has transparent background for the input element

If you have dark-mode feature in your app you must use color-scheme property to indicate color schemes of your app

Duncank commented 1 week ago

Ah; thank you for that insight, that indeed works as it should. Btw: I've setup the dark mode according to the description in the shadcn docs and I did not spot this info there.