I am using shadcn-vue's sonner component, and i found the close button's icon color and border color are incorrect while using dark mode.
As you can see, there is a "X" button while using light theme
But when i switch to dark mode, the color of "X" is still black, and the border's color is too bright and too thick.
I checked out the source code, I found shadcn-vue overwrite the --normal-border, which works fine with the toast main body. But the change did not works on close button.
|
color: var(--gray12); |
|
background: var(--normal-bg); |
|
border: 1px solid var(--gray4); |
Here is the reason that icon's color and border's color not changed. The close button is using fixed --gray12 and --gray4. I am wondering, why did not use normal-text and normal-border like toaster content. Is it a bug or not?
If it is a bug, i created a PR to change the setting, I looked the definition for dark and light theme, it is using --gray3 for border, which is slightly different with current --gray4, please notice if it is important.
Also, i noticed that hover for close button is using --gray fixed color too. If need help, i can submit another change too.
If this is not bug, pls close my PR and this issue.
I am using
shadcn-vue's sonner component, and i found the close button's icon color and border color are incorrect while using dark mode.As you can see, there is a "X" button while using light theme
But when i switch to dark mode, the color of "X" is still black, and the border's color is too bright and too thick.
I checked out the source code, I found
shadcn-vueoverwrite the--normal-border, which works fine with the toast main body. But the change did not works on close button.vue-sonner/src/packages/Toaster.vue
Lines 742 to 744 in 4f6e303
Here is the reason that icon's color and border's color not changed. The close button is using fixed
--gray12and--gray4. I am wondering, why did not usenormal-textandnormal-borderlike toaster content. Is it a bug or not?If it is a bug, i created a PR to change the setting, I looked the definition for dark and light theme, it is using
--gray3for border, which is slightly different with current--gray4, please notice if it is important.Also, i noticed that hover for close button is using
--grayfixed color too. If need help, i can submit another change too.If this is not bug, pls close my PR and this issue.