From 686595627e414d703192bb712bffaec455f51720 Mon Sep 17 00:00:00 2001 From: Zhi Cun Date: Fri, 19 Apr 2019 11:57:20 +0800 Subject: [PATCH] Alert: Add dark theme (#15041) --- examples/docs/en-US/alert.md | 44 +++++++++++++++--- examples/docs/es/alert.md | 34 +++++++++++++- examples/docs/fr-FR/alert.md | 34 +++++++++++++- examples/docs/zh-CN/alert.md | 34 ++++++++++++++ packages/alert/src/main.vue | 11 ++++- packages/theme-chalk/src/alert.scss | 72 +++++++++++++++++++++++------ test/unit/specs/alert.spec.js | 8 ++++ types/alert.d.ts | 4 ++ 8 files changed, 216 insertions(+), 25 deletions(-) diff --git a/examples/docs/en-US/alert.md b/examples/docs/en-US/alert.md index 7cea46f3a..a1190bf0f 100644 --- a/examples/docs/en-US/alert.md +++ b/examples/docs/en-US/alert.md @@ -30,6 +30,37 @@ Alert components are non-overlay elements in the page that does not disappear au ``` ::: +### Theme + +Alert provide two different themes, `light` and `dark`. + +:::demo Set `effect` to change theme, default is `light`. +```html + +``` +::: + ### Customizable close button Customize the close button as texts or other symbols. @@ -190,12 +221,13 @@ Description includes a message with more detailed information. | Attribute | Description | Type | Accepted Values | Default | |---------- |-------------- |---------- |-------------------------------- |-------- | | title | title | string | — | — | -| type | component type | string | success/warning/info/error | info | -| description | descriptive text. Can also be passed with the default slot | string | — | — | -| closable | if closable or not | boolean | — | true | -| center | whether to center the text | boolean | — | false | -| close-text | customized close button text | string | — | — | -| show-icon | if a type icon is displayed | boolean | — | false | +| type | Component type | string | success/warning/info/error | info | +| description | Descriptive text. Can also be passed with the default slot | string | — | — | +| closable | If closable or not | boolean | — | true | +| center | Whether to center the text | boolean | — | false | +| close-text | Customized close button text | string | — | — | +| show-icon | If a type icon is displayed | boolean | — | false | +| effect | Choose theme | string | light/dark | light | ### Slot diff --git a/examples/docs/es/alert.md b/examples/docs/es/alert.md index 8e8761853..d95334e51 100644 --- a/examples/docs/es/alert.md +++ b/examples/docs/es/alert.md @@ -30,7 +30,38 @@ Los componentes de alertas no son elementos overlay de la página y no desaparec ``` ::: -### Personalización del botón de cerrar +### Theme + +Alert provide two different themes, `light` and `dark`. + +:::demo Set `effect` to change theme, default is `light`. +```html + +``` +::: + +### Personalización del botón de cerrar Personalizar el botón de cerrar como texto u otros símbolos. @@ -198,6 +229,7 @@ Descripción incluye un mensaje con información más detallada. | center | si el texto debe estar centrado | boolean | — | false | | close-text | texto de cerrado personalizado | string | — | — | | show-icon | si un icono del tipo de alerta se debe mostrar | boolean | — | false | +| effect | Choose theme | string | light/dark | light | ### Slot diff --git a/examples/docs/fr-FR/alert.md b/examples/docs/fr-FR/alert.md index ac75ad4b6..f63eaab8d 100644 --- a/examples/docs/fr-FR/alert.md +++ b/examples/docs/fr-FR/alert.md @@ -1,4 +1,4 @@ -## Alerte +## Alert Affiche des messages importants. @@ -30,6 +30,37 @@ Les Alertes sont des composants non-superposés qui ne disparaissent pas automat ``` ::: +### Theme + +Alert provide two different themes, `light` and `dark`. + +:::demo Set `effect` to change theme, default is `light`. +```html + +``` +::: + ### Bouton personnalisable Personnalisez le bouton de fermeture avec du texte ou des symboles. @@ -196,6 +227,7 @@ Contient un message avec plus d'informations. | center | Si le texte doit être centré ou non. | boolean | — | false | | close-text | Texte personnalisé pour le bouton de fermeture. | string | — | — | | show-icon | Si une icône s'affiche ou non. | boolean | — | false | +| effect | Choose theme | string | light/dark | light | ### Slot diff --git a/examples/docs/zh-CN/alert.md b/examples/docs/zh-CN/alert.md index 4da75b7f4..2568d150e 100644 --- a/examples/docs/zh-CN/alert.md +++ b/examples/docs/zh-CN/alert.md @@ -29,6 +29,39 @@ ``` ::: +### 主题 + +Alert 组件提供了两个不同的主题:`light`和`dark`。 + +:::demo 通过设置`effect`属性来改变主题,默认为`light`。 +```html + +``` +::: + + + ### 自定义关闭按钮 自定义关闭按钮为文字或其他符号。 @@ -190,6 +223,7 @@ | center | 文字是否居中 | boolean | — | true | | close-text | 关闭按钮自定义文本 | string | — | — | | show-icon | 是否显示图标 | boolean | — | false | +| effect | 选择提供的主题 | string | light/dark | light | ### Slot diff --git a/packages/alert/src/main.vue b/packages/alert/src/main.vue index 1807d19fc..f4bcb47d9 100644 --- a/packages/alert/src/main.vue +++ b/packages/alert/src/main.vue @@ -2,7 +2,7 @@