Blame view

src/styles/components/tooltip.less 3.03 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
  @tooltip-max-width: 250px;
  @tooltip-arrow-width: 5px;
  @tooltip-distance: @tooltip-arrow-width - 1 + 4;
16e85053   梁灏   Tooltip add prop ...
6
7
8
9
10
  
  @tooltip-arrow-width-light: 7px;
  @tooltip-distance-light: @tooltip-arrow-width-light - 1 + 4;
  @tooltip-arrow-outer-width-light: (@tooltip-arrow-width-light + 1);
  @tooltip-arrow-color: hsla(0,0%,85%,.5);
dce3e753   梁灏   add Tooltip compo...
11
12
13
14
  
  .@{tooltip-prefix-cls} {
      display: inline-block;
  
7570318b   梁灏   fixed Tooltip pla...
15
16
17
18
19
      &-rel{
          display: inline-block;
          position: relative;
      }
  
dce3e753   梁灏   add Tooltip compo...
20
      &-popper{
9699c270   梁灏   add Poptip component
21
          .popper(@tooltip-arrow, @tooltip-arrow-width, @tooltip-distance, @tooltip-bg);
dce3e753   梁灏   add Tooltip compo...
22
      }
46c07066   梁灏   update Poptip style
23
      &-light&-popper{
16e85053   梁灏   Tooltip add prop ...
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
          .popper(@tooltip-arrow, @tooltip-arrow-width-light, @tooltip-distance-light, @tooltip-arrow-color);
  
          &[x-placement^="top"] .@{tooltip-arrow}:after {
              content: " ";
              bottom: 1px;
              margin-left: -@tooltip-arrow-width-light;
              border-bottom-width: 0;
              border-top-width: @tooltip-arrow-width-light;
              border-top-color: #fff;
          }
  
          &[x-placement^="right"] .@{tooltip-arrow}:after {
              content: " ";
              left: 1px;
              bottom: -@tooltip-arrow-width-light;
              border-left-width: 0;
              border-right-width: @tooltip-arrow-width-light;
              border-right-color: #fff;
          }
46c07066   梁灏   update Poptip style
43
  
16e85053   梁灏   Tooltip add prop ...
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
          &[x-placement^="bottom"] .@{tooltip-arrow}:after {
              content: " ";
              top: 1px;
              margin-left: -@tooltip-arrow-width-light;
              border-top-width: 0;
              border-bottom-width: @tooltip-arrow-width-light;
              border-bottom-color: #fff;
          }
  
          &[x-placement^="left"] .@{tooltip-arrow}:after {
              content: " ";
              right: 1px;
              border-right-width: 0;
              border-left-width: @tooltip-arrow-width-light;
              border-left-color: #fff;
              bottom: -@tooltip-arrow-width-light;
          }
      }
dce3e753   梁灏   add Tooltip compo...
62
63
64
65
  
      &-inner{
          max-width: @tooltip-max-width;
          min-height: 34px;
650ce7b8   梁灏   optimize Tooltip ...
66
          padding: 8px 12px;
dce3e753   梁灏   add Tooltip compo...
67
68
69
70
71
72
          color: @tooltip-color;
          text-align: left;
          text-decoration: none;
          background-color: @tooltip-bg;
          border-radius: @border-radius-small;
          box-shadow: @shadow-base;
7d5431d8   梁灏   update some style
73
          white-space: nowrap;
6b498dd1   梁灏   Tooltip add maxWi...
74
75
76
77
78
  
          &-with-width{
              white-space: pre-wrap;
              text-align: justify;
          }
dce3e753   梁灏   add Tooltip compo...
79
80
      }
  
46c07066   梁灏   update Poptip style
81
82
83
84
85
      &-light &-inner{
          background-color: #fff;
          color: @text-color;
      }
  
dce3e753   梁灏   add Tooltip compo...
86
87
88
89
90
91
92
      &-arrow{
          position: absolute;
          width: 0;
          height: 0;
          border-color: transparent;
          border-style: solid;
      }
16e85053   梁灏   Tooltip add prop ...
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
  
      &-light {
          .@{tooltip-arrow}{
              &:after{
                  display: block;
                  width: 0;
                  height: 0;
                  position: absolute;
                  border-color: transparent;
                  border-style: solid;
                  content: "";
                  border-width: @tooltip-arrow-width-light;
              }
              border-width: @tooltip-arrow-outer-width-light;
          }
      }
dce3e753   梁灏   add Tooltip compo...
109
  }