From 22287ce99b0ac5c6c0ab9779f715482e2aca6701 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=87=91=E9=B8=BF?= Date: Wed, 9 Jan 2019 12:25:17 +0800 Subject: [PATCH 1/2] style changes: add max-width:250px to popover; move bg color form inner to content --- HISTORY.md | 4 ++++ demo/TooltipDemo.jsx | 7 ++++--- src/Tooltip.js | 2 ++ src/Tooltip.less | 5 +++-- 4 files changed, 13 insertions(+), 5 deletions(-) diff --git a/HISTORY.md b/HISTORY.md index 7142feb..fe7a1a8 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -1,6 +1,10 @@ History ======= +0.4.10 + +* `CHANGED` style changes: add max-width:250px to popover; move bg color form inner to content + 0.4.9 --- diff --git a/demo/TooltipDemo.jsx b/demo/TooltipDemo.jsx index 292257e..b84268e 100644 --- a/demo/TooltipDemo.jsx +++ b/demo/TooltipDemo.jsx @@ -5,6 +5,7 @@ import Button from 'uxcore-button'; export default class Demo extends React.Component { render() { const overlay =
提示文字
; + const longOverlay =
特别特别长的提示文字特别特别长的提示文字特别特别长的提示文字特别特别长的提示文字
; return (
@@ -17,13 +18,13 @@ export default class Demo extends React.Component {

讲解:鼠标点击出现提示

- + - + - +
diff --git a/src/Tooltip.js b/src/Tooltip.js index a74532f..75840ed 100644 --- a/src/Tooltip.js +++ b/src/Tooltip.js @@ -2,9 +2,11 @@ import RcTooltip from 'rc-tooltip'; export default class Tooltip extends RcTooltip { static displayName = 'uxcore-tooltip' + static propTypes = { ...RcTooltip.propTypes, } + static defaultProps = { ...RcTooltip.defaultProps, prefixCls: 'kuma-tooltip', diff --git a/src/Tooltip.less b/src/Tooltip.less index 1df0262..12875c1 100644 --- a/src/Tooltip.less +++ b/src/Tooltip.less @@ -159,6 +159,8 @@ box-shadow: @box-shadow-1; border-radius: @global-border-radius; border: 1px solid @normal-alpha-6; + background-color: #fff; + max-width: 250px; } &-inner { position: relative; @@ -169,16 +171,15 @@ text-align: center; color: @normal-alpha-2; text-decoration: none; - background-color: #fff; } } .@{__tooltipPrefixCls}-dark { .@{__tooltipPrefixCls}-content { border-color: @__tooltipDarkColorNoAlpha; + background: @__tooltipDarkColorNoAlpha; } .@{__tooltipPrefixCls}-inner { - background: @__tooltipDarkColorNoAlpha; color: white; } &.@{__tooltipPrefixCls}-placement-left, From b70dfa440572c2346d12dafc318739a99f197b99 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=87=91=E9=B8=BF?= Date: Wed, 9 Jan 2019 15:35:09 +0800 Subject: [PATCH 2/2] style: pull back max-width style change --- HISTORY.md | 2 +- src/Tooltip.less | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/HISTORY.md b/HISTORY.md index fe7a1a8..bae2fd7 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -3,7 +3,7 @@ History 0.4.10 -* `CHANGED` style changes: add max-width:250px to popover; move bg color form inner to content +* `CHANGED` style change: move bg color form inner to content 0.4.9 --- diff --git a/src/Tooltip.less b/src/Tooltip.less index 12875c1..3a0f5c9 100644 --- a/src/Tooltip.less +++ b/src/Tooltip.less @@ -160,7 +160,7 @@ border-radius: @global-border-radius; border: 1px solid @normal-alpha-6; background-color: #fff; - max-width: 250px; + // max-width: 320px; } &-inner { position: relative;