问题
So the component lib has a dark theme.
I would like to use dark style only for a single component, say a Popover
. All the rest sd remain default.
Is there a way to achieve that?
回答1:
you could use less reference import
feature for theming single component. Sudo code would be something like
@import (reference) "@ant-design/dark-theme"
.my-popover {
&:extend(@popover-prefix-cls all);
}
you can find the class name @popover-prefix-cls
by going into individual components styles file and checking the class
References: https://css-tricks.com/reference-imports-in-less-are-kinda-cool/
来源:https://stackoverflow.com/questions/59895977/antd-how-to-use-dark-theme-for-a-single-component