Skip to content

Commit 97561fa

Browse files
author
Joe Crick
committed
(master): Add tooltip
1 parent d25f639 commit 97561fa

File tree

9 files changed

+201
-108
lines changed

9 files changed

+201
-108
lines changed

index.html

Lines changed: 107 additions & 84 deletions
Large diffs are not rendered by default.

main.css

Lines changed: 41 additions & 18 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

main.css.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/components/modal.less

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,6 @@
1111

1212
}
1313

14-
.open-modal {
15-
.button();
16-
}
17-
1814
.modal-container {
1915
position: fixed;
2016
width: 100%;

src/components/popover.less

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88

99
.popover-toggle-label,
1010
.popover-toggle-dismissable {
11-
.button();
1211
cursor: pointer;
1312
}
1413

src/components/tooltip.less

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
@import '../lib/variables';
2+
3+
.tooltip {
4+
display: inline-block;
5+
position: absolute;
6+
7+
@media @small-device {
8+
min-width: 0;
9+
font-size: 12px;
10+
}
11+
12+
.tooltip-target {
13+
cursor: help;
14+
15+
&:hover + .tooltip-body {
16+
display: block;
17+
}
18+
19+
}
20+
21+
.tooltip-body {
22+
display: none;
23+
position: absolute;
24+
padding: 20px;
25+
text-align: justify;
26+
min-width: 250px;
27+
max-width: 350px;
28+
z-index: 2000;
29+
30+
@media @medium-device {
31+
min-width: 200px;
32+
}
33+
34+
@media @small-device {
35+
left: -150px;
36+
max-width: 200px;
37+
min-width: 100px;
38+
}
39+
40+
}
41+
42+
}

src/layout.less

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,9 @@ body {
2525
border: 1px solid green;
2626
}
2727

28+
.tooltip-body {
29+
margin-top: -100px;
30+
margin-left: 100px;
31+
}
32+
2833
}

src/lib/variables.less

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,7 @@
77

88
// SIZES
99
@arrow-size: 15px;
10+
11+
// MEDIA QUERIES
12+
@small-device: ~'only screen and (max-width: 479px)';
13+
@medium-device: ~'only screen and (min-width: 768px) and (max-width: 959px)';

src/stand-alone-imports.less

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
@import 'components/carousel';
66
@import 'components/popover';
77
@import 'components/collapse';
8+
@import 'components/tooltip';
89

910
.invisible {
1011
display: none;

0 commit comments

Comments
 (0)