feat(Notify): add @notify-text-color less var

This commit is contained in:
陈嘉涵 2020-01-28 16:13:22 +08:00
parent cfadcefb0a
commit 9dcf57c65f
5 changed files with 10 additions and 13 deletions

View File

@ -1,6 +1,5 @@
// Utils
import { createNamespace } from '../utils';
import { WHITE } from '../utils/constant';
import { inherit } from '../utils/functional';
// Mixins
@ -54,6 +53,7 @@ function Notify(
Notify.props = {
...popupMixinProps,
color: String,
background: String,
className: null as any,
message: [Number, String],
@ -62,10 +62,6 @@ Notify.props = {
type: String,
default: 'danger',
},
color: {
type: String,
default: WHITE,
},
duration: {
type: Number,
default: 3000,

View File

@ -3,6 +3,7 @@
.van-notify {
box-sizing: border-box;
padding: @notify-padding;
color: @notify-text-color;
font-size: @notify-font-size;
line-height: @notify-line-height;

View File

@ -1,6 +1,5 @@
import Vue from 'vue';
import VanNotify from './Notify';
import { WHITE } from '../utils/constant';
import { isObject, isServer } from '../utils';
import { mount } from '../utils/functional';
import { NotifyOptions } from 'types/notify';
@ -60,7 +59,7 @@ function defaultOptions(): NotifyOptions {
type: 'danger',
value: true,
message: '',
color: WHITE,
color: undefined,
background: undefined,
duration: 3000,
className: '',

View File

@ -1,13 +1,13 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`create a notify 1`] = `<div class="van-popup van-popup--top van-notify van-notify--danger" style="transition-duration: 0.2s; color: rgb(255, 255, 255); z-index: 2001;" name="van-popup-slide-top">test</div>`;
exports[`create a notify 1`] = `<div class="van-popup van-popup--top van-notify van-notify--danger" style="transition-duration: 0.2s; z-index: 2001;" name="van-popup-slide-top">test</div>`;
exports[`notify disappear 1`] = `<div class="van-popup van-popup--top van-notify van-notify--danger" style="transition-duration: 0.2s; color: red; z-index: 2001; background: blue;" name="van-popup-slide-top">test</div>`;
exports[`notify disappear 1`] = `<div class="van-popup van-popup--top van-notify van-notify--danger" style="transition-duration: 0.2s; z-index: 2001; color: red; background: blue;" name="van-popup-slide-top">test</div>`;
exports[`notify disappear 2`] = `<div class="van-popup van-popup--top van-notify van-notify--danger" style="transition-duration: 0.2s; color: red; z-index: 2001; background: blue; display: none;" name="van-popup-slide-top">test</div>`;
exports[`notify disappear 2`] = `<div class="van-popup van-popup--top van-notify van-notify--danger" style="transition-duration: 0.2s; z-index: 2001; color: red; background: blue; display: none;" name="van-popup-slide-top">test</div>`;
exports[`notify disappear 3`] = `<div class="van-popup van-popup--top van-notify van-notify--danger" style="transition-duration: 0.2s; color: rgb(255, 255, 255); z-index: 2002;" name="van-popup-slide-top">text2</div>`;
exports[`notify disappear 3`] = `<div class="van-popup van-popup--top van-notify van-notify--danger" style="transition-duration: 0.2s; z-index: 2002;" name="van-popup-slide-top">text2</div>`;
exports[`notify disappear 4`] = `<div class="van-popup van-popup--top van-notify van-notify--danger" style="transition-duration: 0.2s; color: rgb(255, 255, 255); z-index: 2002; display: none;" name="van-popup-slide-top">text2</div>`;
exports[`notify disappear 4`] = `<div class="van-popup van-popup--top van-notify van-notify--danger" style="transition-duration: 0.2s; z-index: 2002; display: none;" name="van-popup-slide-top">text2</div>`;
exports[`type prop 1`] = `<div class="van-popup van-popup--top van-notify van-notify--primary" style="transition-duration: 0.2s; color: rgb(255, 255, 255); z-index: 2001;" name="van-popup-slide-top">test</div>`;
exports[`type prop 1`] = `<div class="van-popup van-popup--top van-notify van-notify--primary" style="transition-duration: 0.2s; z-index: 2001;" name="van-popup-slide-top">test</div>`;

View File

@ -445,6 +445,7 @@
@notice-bar-icon-min-width: 22px;
// Notify
@notify-text-color: @white;
@notify-padding: @padding-xs @padding-md;
@notify-font-size: @font-size-md;
@notify-line-height: 20px;