update Alert style

This commit is contained in:
梁灏 2018-06-25 10:10:18 +08:00
parent 8390064d4e
commit 27b03d14f8
4 changed files with 43 additions and 16 deletions

View file

@ -1,8 +1,28 @@
<template>
<div>
<Alert show-icon banner closable>消息提示文案</Alert>
<Alert>
An info prompt
<template slot="desc">Content of prompt. Content of prompt. Content of prompt. Content of prompt. </template>
</Alert>
<Alert type="success">
A success prompt
<template slot="desc">Content of prompt. Content of prompt. Content of prompt. Content of prompt. </template>
</Alert>
<Alert type="warning">
A warning prompt
<template slot="desc">
Content of prompt. Content of prompt. Content of prompt.
</template>
</Alert>
<Alert type="error">
An error prompt
<span slot="desc">
Custom error description copywriting. <Icon type="help-circled" size="14"></Icon>
</span>
</Alert>
<Alert type="info" show-icon closable>消息提示文案</Alert>
<Alert type="success" show-icon>成功提示文案</Alert>
<Alert type="warning" show-icon banner>警告提示文案</Alert>
<Alert type="warning" show-icon>警告提示文案</Alert>
<Alert type="error" show-icon>错误提示文案</Alert>
<Alert show-icon>
消息提示文案

View file

@ -80,19 +80,20 @@
switch (this.type) {
case 'success':
type = 'checkmark-circled';
type = 'ios-checkmark';
break;
case 'info':
type = 'information-circled';
type = 'ios-information';
break;
case 'warning':
type = 'android-alert';
break;
case 'error':
type = 'close-circled';
type = 'ios-close';
break;
}
if (this.desc) type += '-outline';
return type;
}
},

View file

@ -4,7 +4,7 @@
.@{alert-prefix-cls}{
position: relative;
padding: 8px 48px 8px 16px;
border-radius: @border-radius-base;
border-radius: @border-radius-small;
color: @text-color;
font-size: @font-size-small;
line-height: 16px;
@ -15,7 +15,7 @@
}
&-icon {
font-size: @font-size-base;
font-size: @font-size-large;
top: 8px;
left: 16px;
position: absolute;
@ -30,32 +30,36 @@
}
&-success {
border: 1px solid tint(@success-color, 80%);
background-color: tint(@success-color, 90%);
border: @border-width-base @border-style-base ~`colorPalette("@{success-color}", 3)`;
//background-color: tint(@success-color, 90%);
background-color: ~`colorPalette("@{success-color}", 1)`;
.@{alert-prefix-cls}-icon {
color: @success-color;
}
}
&-info {
border: 1px solid tint(@primary-color, 80%);
background-color: tint(@primary-color, 90%);
border: @border-width-base @border-style-base ~`colorPalette("@{primary-color}", 3)`;
//background-color: tint(@primary-color, 90%);
background-color: ~`colorPalette("@{primary-color}", 1)`;
.@{alert-prefix-cls}-icon {
color: @primary-color;
}
}
&-warning {
border: 1px solid tint(@warning-color, 80%);
background-color: tint(@warning-color, 90%);
border: @border-width-base @border-style-base ~`colorPalette("@{warning-color}", 3)`;
//background-color: tint(@warning-color, 90%);
background-color: ~`colorPalette("@{warning-color}", 1)`;
.@{alert-prefix-cls}-icon {
color: @warning-color;
}
}
&-error {
border: 1px solid tint(@error-color, 80%);
background-color: tint(@error-color, 90%);
border: @border-width-base @border-style-base ~`colorPalette("@{error-color}", 3)`;
//background-color: tint(@error-color, 90%);
background-color: ~`colorPalette("@{error-color}", 1)`;
.@{alert-prefix-cls}-icon {
color: @error-color;
}
@ -68,7 +72,7 @@
&-with-desc {
padding: 16px;
position: relative;
border-radius: @border-radius-base;
border-radius: @border-radius-small;
margin-bottom: 10px;
color: @text-color;
line-height: 1.5;

View file

@ -38,6 +38,8 @@
// Border color
@border-color-base : #dddee1; // outside
@border-color-split : #e9eaec; // inside
@border-width-base : 1px; // width of the border for a component
@border-style-base : solid; // style of a components border
// Background color
@background-color-base : #f7f7f7; // base