summaryrefslogtreecommitdiffstats
path: root/packages/gitbook-plugin-theme-default/less/Tooltipped.less
blob: 126daabed1daca8a6ee58a5da448e26547cf42f3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
.GitBook-Tooltipped {
    display: inline-block;
    position: relative;

    &:hover, &.Tooltipped-o {
        &:after {
            line-height: 1em;
            background: @tooltip-background;
            border-radius: @tooltip-radius;
            bottom: auto;
            top: ~"calc(100% + 10px)";
            color: @tooltip-color;
            content: attr(aria-label);
            display: block;
            left: 50%;
            padding: 5px 5px;
            position: absolute;
            white-space: nowrap;
            z-index: @zindex-tooltip;
            font-size: 13px;
            text-transform: none;
            font-weight: @font-size-base;
            pointer-events: none;
            transform: translateX(-50%);
        }

        &:before {
            border: solid;
            border-color: @tooltip-background transparent;
            bottom:auto;
            top: ~"calc(100% + 5px)";
            border-width: 0px 5px 5px 5px;
            content: "";
            display: block;
            left: 50%;
            position: absolute;
            z-index: @zindex-tooltip+1;
            transform: translateX(-50%);
        }
    }

    .north() {
        &:after {
            top: auto;
            bottom: ~"calc(100% + 10px)";
            transform: translateX(0%);
        }
        &:before {
            top: auto;
            border-width: 5px 5px 0px 5px;
            bottom: ~"calc(100% + 5px)";
            transform: translateX(0%);
        }
    }
    .west() {
        &:after {
            left: auto;
            right: 5px;
            transform: translateX(0%);
        }
        &:before {
            left: auto;
            right: 10px;
            transform: translateX(0%);
        }
    }
    .east() {
        &:after {
            right: auto;
            left: 5px;
            transform: translateX(0%);
        }
        &:before {
            right: auto;
            left: 10px;
            transform: translateX(0%);
        }
    }

    &.Tooltipped-e {
        .east()
    }

    &.Tooltipped-n {
        .north();
    }

    &.Tooltipped-ne {
        .north();
        .east();
    }

    &.Tooltipped-nw {
        .north();
        .west();
    }
    &.Tooltipped-sw, &.Tooltipped-w {
        .west();
    }
}