Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Custom Type for Unstyled Tooltip #293

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

Closed
wylie wants to merge 3 commits into ReactTooltip:master from wylie:master
Closed
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
2 changes: 1 addition & 1 deletion README.md
View file Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ Check example: [React-tooltip Test](http://wwayne.com/react-tooltip)
Global|Specific |Type |Values | Description
|:---|:---|:---|:---|:----
place | data-place | String | top, right, bottom, left | placement
type | data-type | String | success, warning, error, info, light | theme
type | data-type | String | success, warning, error, info, light, custom | theme
effect| data-effect | String | float, solid | behaviour of tooltip
event | data-event | String | e.g. click | custom event to trigger tooltip
eventOff | data-event-off | String | e.g. click | custom event to hide tooltip (only makes effect after setting event attribute)
Expand Down
3 changes: 2 additions & 1 deletion src/index.js
View file Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -439,7 +439,8 @@ class ReactTooltip extends Component {
{'type-warning': this.state.type === 'warning'},
{'type-error': this.state.type === 'error'},
{'type-info': this.state.type === 'info'},
{'type-light': this.state.type === 'light'}
{'type-light': this.state.type === 'light'},
{'type-custom': !this.state.type}
Copy link
Collaborator

@aronhelser aronhelser Apr 23, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so 'custom' ends up being the same as not specifying a type, correct?

To merge this, I'd like to see an example added to illustrate how to use it.

thedaviddias reacted with thumbs up emoji
)

let Wrapper = this.props.wrapper
Expand Down
6 changes: 3 additions & 3 deletions src/index.scss
View file Open in desktop
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
@mixin type($background-color) {
background-color: $background-color;
border-radius: 3px;
font-size: 13px;
padding: 8px 21px;
Copy link
Collaborator

@aronhelser aronhelser Apr 23, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see what you want to do - but adding them to something named 'background-color' seems misleading. Maybe we can define another mixing type, like base-sizing or something?

&.place-top {
&:after {
border-top-color: $background-color;
Expand Down Expand Up @@ -55,12 +58,9 @@
}

.__react_component_tooltip {
border-radius: 3px;
display: inline-block;
font-size: 13px;
left: -999em;
opacity: 0;
padding: 8px 21px;
position: fixed;
pointer-events: none;
transition: opacity 0.3s ease-out;
Expand Down
2 changes: 1 addition & 1 deletion src/style.css
View file Open in desktop

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

AltStyle によって変換されたページ (->オリジナル) /