问题描述
我正在使用查克拉用户界面。
我想将按钮颜色更改为 #2477b3。
我可以通过在props中传递值来改变它,但是每次在props中传递值都需要花费大量的时间和精力,所以我想改变默认的Button颜色等
我想使用A按钮的样式。
我改了theme.ts,创建了一个BButton,但是样式没变。
我尝试更改theme.ts中的值,但颜色没有改变。
<Button
size={'sm'}
bg="#2B6CB0"
_hover={{ bg: '#2477b3' }}
_active={{
bg: '#2477b3',transform: 'scale(0.98)',borderColor: '#2477b3',}}
color={'#ffffff'}
>
AButton
</Button>
<Button>BButton</Button>
theme.ts
import { extendTheme } from '@chakra-ui/react';
export const theme = extendTheme({
components: {
Button: {
baseStyle: {
fontWeight: 'bold',_hover: {
_disabled: {
bg: '#2477b3',},variants: {
bg: '#2B6CB0',_active: {
bg: '#2477b3',});
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)