Skip to content
This repository was archived by the owner on Mar 7, 2023. It is now read-only.

Commit 8cf9233

Browse files
author
Michael Jones
authored
styling info
1 parent 0d9d4d1 commit 8cf9233

File tree

1 file changed

+38
-3
lines changed

1 file changed

+38
-3
lines changed

README.md

Lines changed: 38 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[![Build Status](https://travis-ci.org/nsf-open/nsf-ember-tooltip.svg?branch=master)](https://travis-ci.org/nsf-open/nsf-ember-tooltip)
22
# NSF Ember Tooltip
33

4-
An [ember-cli](https://www.ember-cli.com) addon for using [Tooltipster](https://iamceege.github.io/tooltipster/) in Ember applications.
4+
An [ember-cli](https://www.ember-cli.com) addon for using [Tooltipster](https://iamceege.github.io/tooltipster/) in Ember applications. The default sideTip, and the [ScrollableTip](https://github.com/louisameline/tooltipster-scrollableTip) plugins come preconfigured.
55

66
----
77

@@ -44,10 +44,10 @@ Block form
4444
```
4545
(Note: using `data-tooltip-content` in the component's yield block currently has one limitation: its content cannot be re-rendered. When first created, the component detaches that element from the DOM before passing it to Tooltipster. Sorry, we're working on it!)
4646

47-
## Configuration
47+
## Properties
4848
`{{tool-tip}}` supports (almost) all of the basic options provided by Tooltipster, listed [here](https://iamceege.github.io/tooltipster/#options).
4949

50-
NOTE: We need to deviate from Tooltipster's options in one significant place - the `trigger` option. Since `trigger` is used internally by Ember components, use `tipTrigger` instead.
50+
NOTE: We need to deviate from Tooltipster in one significant place - the `trigger` option. Since `trigger` is used internally by Ember components, use `tipTrigger` instead.
5151

5252
In addition, we have added:
5353

@@ -59,3 +59,38 @@ In addition, we have added:
5959
| showTipOnUpdate | Boolean | false | If true, changes to the `content` value will cause the tooltip to be shown.
6060
| tipTextAttr | String | `"[data-tooltip-content]"` | Any valid jQuery selector that will be used to search the component's block for the tooltip's content.
6161

62+
## Styling
63+
The component provides the core Tooltipster styles and default theme out of the box. If you want to roll your own styles, then you can disable this in your app's `environment.js`:
64+
```javascript
65+
const ENV = {
66+
'nsf-ember-tooltip': {
67+
excludeDefaultStyles: true,
68+
}
69+
};
70+
```
71+
72+
If you are using SASS, the component provides and optional partial file and mixin that you may import to change things up.
73+
74+
To import:
75+
```sass
76+
@import 'nsf-ember-tooltip/styles';
77+
```
78+
79+
Available variables (with their defaults):
80+
```sass
81+
$tooltipster-color: white;
82+
$tooltipster-bg: #565656;
83+
$tooltipster-border: black;
84+
$tooltipster-border-weight: 2px;
85+
$tooltipster-border-radius: 4px;
86+
$tooltipster-arrow-width: 10px;
87+
$tooltipster-padding: 6px 14px;
88+
$tooltipster-line-height: 18px;
89+
```
90+
91+
Using the mixin to create more variants:
92+
```sass
93+
.my-custom-tooltipster-theme-name {
94+
@include tooltipster-variant(color, background-color, border-color [, border-weight: 2px, arrow-width: 10px]);
95+
}
96+
```

0 commit comments

Comments
 (0)