Skip to content

Commit ba656cd

Browse files
Merge pull request #278 from ashmaroli/tooltip
add a tooltip to 'New metadata field' link
2 parents ab84ad4 + b7ab356 commit ba656cd

File tree

3 files changed

+39
-1
lines changed

3 files changed

+39
-1
lines changed

src/containers/MetaFields.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,12 @@ export class MetaFields extends Component {
5252
<div className="metafields">
5353
{metafields}
5454
<div className="meta-new">
55-
<a onClick={() => addField('metadata')}><i className="fa fa-plus-circle"></i>New metadata field</a>
55+
<a onClick={() => addField('metadata')} className="tooltip">
56+
<i className="fa fa-plus-circle"></i> New metadata field
57+
<span className="tooltip-text">
58+
Metadata will be stored as the YAML Front Matter within the document.
59+
</span>
60+
</a>
5661
</div>
5762
</div>
5863
);

src/styles/content.scss

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,4 +186,36 @@
186186
background: #cfcfcf;
187187
border: 0;
188188
}
189+
190+
.tooltip {
191+
position: relative;
192+
193+
.tooltip-text {
194+
display: none;
195+
position: absolute;
196+
top: 36px;
197+
right: -250px;
198+
width: 300px;
199+
padding: 10px;
200+
font-size: 1rem;
201+
color: $white;
202+
text-align: center;
203+
background: $dark-gray;
204+
@include border-radius($border-radius);
205+
206+
&:after {
207+
content: "";
208+
position: absolute;
209+
bottom: 100%;
210+
left: 5%;
211+
border: 9px solid;
212+
border-color: transparent transparent $dark-gray transparent;
213+
}
214+
}
215+
216+
&:hover .tooltip-text {
217+
display: block;
218+
}
219+
}
189220
}
221+

src/styles/variables.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ $dark-red: #f44336;
77
$green: #8bc34a;
88
$off-white: #fafafa;
99
$white: #fcfcfc;
10+
$dark-gray: #727272;
1011
$inactive-gray: #9ea1a3;
1112
$new: #68BD6A;
1213
$new-hover: #80ce81;

0 commit comments

Comments
 (0)