Blame view

styles/components/tooltip.less 3.59 KB
dce3e753   梁灏   add Tooltip compo...
1
  @tooltip-prefix-cls: ~"@{css-prefix}tooltip";
7570318b   梁灏   fixed Tooltip pla...
2
  @tooltip-arrow: ~"@{tooltip-prefix-cls}-arrow";
dce3e753   梁灏   add Tooltip compo...
3
4
5
6
7
8
9
  @tooltip-max-width: 250px;
  @tooltip-arrow-width: 5px;
  @tooltip-distance: @tooltip-arrow-width - 1 + 4;
  
  .@{tooltip-prefix-cls} {
      display: inline-block;
  
7570318b   梁灏   fixed Tooltip pla...
10
11
12
13
14
      &-rel{
          display: inline-block;
          position: relative;
      }
  
dce3e753   梁灏   add Tooltip compo...
15
16
17
18
19
20
21
      &-popper{
          display: block;
          visibility: visible;
          font-size: @font-size-small;
          line-height: @line-height-base;
          position: absolute;
          z-index: @zindex-tooltip;
7570318b   梁灏   fixed Tooltip pla...
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
  
          &[x-placement^="top"] {
              padding: @tooltip-arrow-width 0 @tooltip-distance 0;
          }
          &[x-placement^="right"] {
              padding: 0 @tooltip-arrow-width 0 @tooltip-distance;
          }
          &[x-placement^="bottom"] {
              padding: @tooltip-distance 0 @tooltip-arrow-width 0;
          }
          &[x-placement^="left"] {
              padding: 0 @tooltip-distance 0 @tooltip-arrow-width;
          }
  
          &[x-placement^="top"] .@{tooltip-arrow} {
              bottom: @tooltip-distance - @tooltip-arrow-width;
              border-width: @tooltip-arrow-width @tooltip-arrow-width 0;
              border-top-color: @tooltip-bg;
          }
          &[x-placement="top"] .@{tooltip-arrow} {
              left: 50%;
              margin-left: -@tooltip-arrow-width;
          }
          &[x-placement="top-start"] .@{tooltip-arrow} {
              left: 16px;
          }
          &[x-placement="top-end"] .@{tooltip-arrow} {
              right: 16px;
          }
  
          &[x-placement^="right"] .@{tooltip-arrow} {
              left: @tooltip-distance - @tooltip-arrow-width;
              border-width: @tooltip-arrow-width @tooltip-arrow-width @tooltip-arrow-width 0;
              border-right-color: @tooltip-bg;
          }
          &[x-placement="right"] .@{tooltip-arrow} {
              top: 50%;
              margin-top: -@tooltip-arrow-width;
          }
          &[x-placement="right-start"] .@{tooltip-arrow} {
              top: 8px;
          }
          &[x-placement="right-end"] .@{tooltip-arrow} {
              bottom: 8px;
          }
  
          &[x-placement^="left"] .@{tooltip-arrow} {
              right: @tooltip-distance - @tooltip-arrow-width;
              border-width: @tooltip-arrow-width 0 @tooltip-arrow-width @tooltip-arrow-width;
              border-left-color: @tooltip-bg;
          }
          &[x-placement="left"] .@{tooltip-arrow} {
              top: 50%;
              margin-top: -@tooltip-arrow-width;
          }
          &[x-placement="left-start"] .@{tooltip-arrow} {
              top: 8px;
          }
          &[x-placement="left-end"] .@{tooltip-arrow} {
              bottom: 8px;
          }
  
          &[x-placement^="bottom"] .@{tooltip-arrow} {
              top: @tooltip-distance - @tooltip-arrow-width;
              border-width: 0 @tooltip-arrow-width @tooltip-arrow-width;
              border-bottom-color: @tooltip-bg;
          }
          &[x-placement="bottom"] .@{tooltip-arrow} {
              left: 50%;
              margin-left: -@tooltip-arrow-width;
          }
          &[x-placement="bottom-start"] .@{tooltip-arrow} {
              left: 16px;
          }
          &[x-placement="bottom-end"] .@{tooltip-arrow} {
              right: 16px;
          }
dce3e753   梁灏   add Tooltip compo...
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
      }
  
      &-inner{
          max-width: @tooltip-max-width;
          min-height: 34px;
          padding: 8px 10px;
          color: @tooltip-color;
          text-align: left;
          text-decoration: none;
          background-color: @tooltip-bg;
          border-radius: @border-radius-small;
          box-shadow: @shadow-base;
      }
  
      &-arrow{
          position: absolute;
          width: 0;
          height: 0;
          border-color: transparent;
          border-style: solid;
      }
dce3e753   梁灏   add Tooltip compo...
120
  }