diff --git a/packages/ui/modal/src/index.less b/packages/ui/modal/src/index.less index e32510dd4f70a5888070613ed46e95167286a61e..80649496a3e9865f0d9536cdc2a6e9c389cc233e 100644 --- a/packages/ui/modal/src/index.less +++ b/packages/ui/modal/src/index.less @@ -50,46 +50,45 @@ } .@{osui-modal-class-prefix}-confirm { - &-icon svg.osui-icon { - float: left; - width: 36px; - height: 36px; - margin-right: 20px; - font-size: 14px; - } - .@{ant-prefix}-modal-confirm-body { min-height: 76px; border-bottom: var(--modal-body-border-bottom); + + & > svg.osui-icon { + float: left; + width: 36px; + height: 36px; + margin-right: 20px; + font-size: 14px; + } } .@{ant-prefix}-modal-confirm-content { margin-bottom: 40px; - margin-left: 55px; } .@{ant-prefix}-modal-confirm-btns { margin-top: 15px; } - &.@{ant-prefix}-modal-confirm-warning .@{ant-prefix}-modal-confirm-body &-icon svg.osui-icon, - &.@{ant-prefix}-modal-confirm-confirm .@{ant-prefix}-modal-confirm-body &-icon svg.osui-icon { + &.@{ant-prefix}-modal-confirm-warning .@{ant-prefix}-modal-confirm-body > svg.osui-icon, + &.@{ant-prefix}-modal-confirm-confirm .@{ant-prefix}-modal-confirm-body > svg.osui-icon { color: var(--theme-warning-color); } - &.@{ant-prefix}-modal-confirm-success .@{ant-prefix}-modal-confirm-body &-icon svg.osui-icon { + &.@{ant-prefix}-modal-confirm-success .@{ant-prefix}-modal-confirm-body > svg.osui-icon { color: var(--theme-success-color); } - &.@{ant-prefix}-modal-confirm-info .@{ant-prefix}-modal-confirm-body &-icon svg.osui-icon { + &.@{ant-prefix}-modal-confirm-info .@{ant-prefix}-modal-confirm-body > svg.osui-icon { color: var(--theme-info-color); } - &.@{ant-prefix}-modal-confirm-error .@{ant-prefix}-modal-confirm-body &-icon svg.osui-icon { + &.@{ant-prefix}-modal-confirm-error .@{ant-prefix}-modal-confirm-body > svg.osui-icon { color: var(--theme-error-color); } - .@{ant-prefix}-modal-confirm-body > .osui-modal-confirm-icon + .@{ant-prefix}-modal-confirm-title + .@{ant-prefix}-modal-confirm-content { + .@{ant-prefix}-modal-confirm-body > svg.osui-icon + .@{ant-prefix}-modal-confirm-title + .@{ant-prefix}-modal-confirm-content { margin-bottom: 40px; margin-left: 55px; } diff --git a/packages/ui/modal/src/index.tsx b/packages/ui/modal/src/index.tsx index 51fd0473b9272fd9cabba20083de5eeaa919e24a..7a4996019ae927233f9139471ade800e0a91d483 100644 --- a/packages/ui/modal/src/index.tsx +++ b/packages/ui/modal/src/index.tsx @@ -150,11 +150,7 @@ const getConfirmConfig = ( const baseConfig = config; // 对confirm图表的样式调整处理 Object.assign(baseConfig, { - icon: ( - - {config.icon ?? confirmIconMap[type]} - - ), + icon: config.hasOwnProperty('icon') ? config.icon : confirmIconMap[type], }); return {