Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

style change: move bg color form inner to content #13

Merged
merged 2 commits into from
Jan 9, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions HISTORY.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
History
=======

0.4.10

* `CHANGED` style change: move bg color form inner to content

0.4.9
---

Expand Down
7 changes: 4 additions & 3 deletions demo/TooltipDemo.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import Button from 'uxcore-button';
export default class Demo extends React.Component {
render() {
const overlay = <div style={{}}>提示文字</div>;
const longOverlay = <div style={{}}>特别特别长的提示文字特别特别长的提示文字特别特别长的提示文字特别特别长的提示文字</div>;
return (
<div className="demo">
<div>
Expand All @@ -17,13 +18,13 @@ export default class Demo extends React.Component {
<h3>讲解:鼠标点击出现提示</h3>
<div className="container">
<div className="top">
<Tooltip overlay={overlay} placement="topLeft" trigger={['click']}>
<Tooltip overlayClassName="kuma-tooltip-dark" overlay={overlay} placement="topLeft" trigger={['click']}>
<Button size="small" type="outline">上左</Button>
</Tooltip>
<Tooltip overlay={overlay} placement="top" trigger={['click']}>
<Tooltip overlayClassName="kuma-tooltip-dark" overlay={longOverlay} placement="top" trigger={['click']}>
<Button style={{ marginLeft: 10 }} size="small" type="outline">上</Button>
</Tooltip>
<Tooltip overlay={overlay} placement="topRight" trigger={['click']}>
<Tooltip overlay={longOverlay} placement="topRight" trigger={['click']} overlayStyle={{ maxWidth: 200 }}>
<Button style={{ marginLeft: 10 }} size="small" type="outline">上右</Button>
</Tooltip>
</div>
Expand Down
2 changes: 2 additions & 0 deletions src/Tooltip.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
5 changes: 3 additions & 2 deletions src/Tooltip.less
Original file line number Diff line number Diff line change
Expand Up @@ -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: 320px;
}
&-inner {
position: relative;
Expand All @@ -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,
Expand Down