Skip to content

Commit

Permalink
feat: alert
Browse files Browse the repository at this point in the history
  • Loading branch information
Erindcl committed Jul 29, 2020
1 parent 9ce199c commit 445a70d
Show file tree
Hide file tree
Showing 6 changed files with 67 additions and 8 deletions.
1 change: 1 addition & 0 deletions components/alert/demo/icon.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ ReactDOM.render(
<Alert style={{ marginBottom: 20 }} message="Success Text" type="success" showIcon closable />
<Alert style={{ marginBottom: 20 }} message="Warning Text" type="warning" showIcon closable />
<Alert style={{ marginBottom: 20 }} message="Error Text" type="error" showIcon closable />
<Alert style={{ marginBottom: 20 }} message="Error Text" type="error" description="Error Description Error Description Error Description Error Description Error Description Error Description" showIcon closable />
</div>,
mountNode,
);
Expand Down
10 changes: 10 additions & 0 deletions components/alert/index.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,18 @@ subtitle: 警告提示

## 设计规范

#### 默认主题

警告提示 不带边框,高度为 44px。不同提示颜色不同。

- 错误提示 背景色为 #FFF1F0
- 警告提示 背景色为 #FFFBE6
- 成功提示 背景色为 #DFFAE6

#### 暗黑主题

警告提示 带边框,背景色为 #1D1F2E,高度为 44px,不通提示颜色不同。

- 错误提示 边框色为 #E25F5D
- 警告提示 边框色为 #C28C3A
- 成功提示 边框色为 #00A755
25 changes: 25 additions & 0 deletions theme/dt-theme/dark/alert.less
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
.ant-alert {
padding: 12px 16px 12px 40px;
}
.ant-alert.ant-alert-no-icon {
padding: 12px 16px;
}
.ant-alert-icon {
top: 13px;
left: 16px;
font-size: 16px;
}
.ant-alert-close-icon {
top: 10px;
right: 14px;
}
.ant-alert-with-description {
padding: 12px 16px 12px 54px;
.ant-alert-icon {
top: 13px;
left: 20px;
}
.ant-alert-close-icon {
top: 12px;
}
}
1 change: 1 addition & 0 deletions theme/dt-theme/dark/index.less
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
@import './resetDark.less';
@import './button.less';
@import './modal.less';
@import './alert.less';

* {
margin: 0;
Expand Down
24 changes: 21 additions & 3 deletions theme/dt-theme/dark/resetDark.less
Original file line number Diff line number Diff line change
Expand Up @@ -443,8 +443,10 @@
// ---
@mentions-dropdown-bg: @popover-background;

// dt-theme
// ==== dt-theme ====
@primary-color: #3F87FF;
@popover-background: #1D1F2E;
@component-background: #1D1F2E;
@heading-color: #F2F2F2;
@font-size-base: 12px;
@text-color: #BFBFBF;
Expand All @@ -460,13 +462,29 @@
@input-placeholder-color: #666666;
@input-height-lg: 36px;
@input-height-sm: 28px;
@input-hover-border-color: #3F87FF;
@input-hover-border-color: @primary-color;
@modal-footer-padding-horizontal: 20px;
@form-item-margin-bottom: 20px;
@label-required-color: #E25F5D;
@label-required-color: @error-color;
@table-header-bg: #222433;
@table-padding-vertical: 19px;
@item-hover-bg: #292D42;
@select-item-selected-bg: #292D42;
@select-item-selected-font-weight: normal;
@modal-header-bg: #1A1C29;
// Alert
@alert-success-border-color: @success-color;
@alert-success-bg-color: #1D1F2E;
@alert-success-icon-color: @success-color;
@alert-info-border-color: @info-color;
@alert-info-bg-color: #1D1F2E;
@alert-info-icon-color: @info-color;
@alert-warning-border-color: @warning-color;
@alert-warning-bg-color: #1D1F2E;
@alert-warning-icon-color: @warning-color;
@alert-error-border-color: @error-color;
@alert-error-bg-color: #1D1F2E;
@alert-error-icon-color: @error-color;
@alert-text-color: @text-color;
@alert-message-color: @text-color;
@alert-close-color: #999999;
14 changes: 9 additions & 5 deletions theme/dt-theme/default/notice.less
Original file line number Diff line number Diff line change
@@ -1,25 +1,29 @@
@import '../const.less';

.ant-alert {
padding: 12px 15px 12px 36px;
padding: 12px 16px 12px 40px;
}
.ant-alert.ant-alert-no-icon {
padding: 12px 15px;
padding: 12px 16px;
}
.ant-alert-icon {
top: 15px;
left: 20px;
top: 13px;
left: 16px;
font-size: 16px;
}
.ant-alert-close-icon {
top: 10px;
right: 14px;
}
.ant-alert-with-description {
padding: 12px 15px 12px 54px;
padding: 12px 16px 12px 54px;
.ant-alert-icon {
top: 13px;
left: 20px;
}
.ant-alert-close-icon {
top: 12px;
}
}
.ant-alert-success {
background-color: #DFFAE6;
Expand Down

0 comments on commit 445a70d

Please sign in to comment.