summaryrefslogtreecommitdiff
path: root/source/bower_components/foundation/scss/foundation/components/_tooltips.scss
blob: f94ff3498c6af7a7909f78de68dd9c4902d83d30 (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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
// Foundation by ZURB
// foundation.zurb.com
// Licensed under MIT Open Source

@import "global";

//
// Tooltip Variables
//
$include-html-tooltip-classes: $include-html-classes !default;

$has-tip-border-bottom: dotted 1px $iron !default;
$has-tip-font-weight: $font-weight-bold !default;
$has-tip-font-color: $oil !default;
$has-tip-border-bottom-hover: dotted 1px scale-color($primary-color, $lightness: -55%) !default;
$has-tip-font-color-hover: $primary-color !default;
$has-tip-cursor-type: help !default;

$tooltip-padding: rem-calc(12) !default;
$tooltip-bg: $oil !default;
$tooltip-font-size: rem-calc(14) !default;
$tooltip-font-weight: $font-weight-normal !default;
$tooltip-font-color: $white !default;
$tooltip-line-height: 1.3 !default;
$tooltip-close-font-size: rem-calc(10) !default;
$tooltip-close-font-weight: $font-weight-normal !default;
$tooltip-close-font-color: $monsoon !default;
$tooltip-font-size-sml: rem-calc(14) !default;
$tooltip-radius: $global-radius !default;
$tooltip-rounded: $global-rounded !default;
$tooltip-pip-size: 5px !default;
$tooltip-max-width: 300px !default;

@include exports("tooltip") {
  @if $include-html-tooltip-classes {

    /* Tooltips */
    .has-tip {
      border-bottom: $has-tip-border-bottom;
      cursor: $has-tip-cursor-type;
      font-weight: $has-tip-font-weight;
      color: $has-tip-font-color;

      &:hover,
      &:focus {
        border-bottom: $has-tip-border-bottom-hover;
        color: $has-tip-font-color-hover;
      }

      &.tip-left,
      &.tip-right { float: none !important; }
    }

    .tooltip {
      display: none;
      position: absolute;
      z-index: 1006;
      font-weight: $tooltip-font-weight;
      font-size: $tooltip-font-size;
      line-height: $tooltip-line-height;
      padding: $tooltip-padding;
      max-width: $tooltip-max-width;
      #{$default-float}: 50%;
      width: 100%;
      color: $tooltip-font-color;
      background: $tooltip-bg;

      &>.nub {
        display: block;
        #{$default-float}: $tooltip-pip-size;
        position: absolute;
        width: 0;
        height: 0;
        border: solid $tooltip-pip-size;
        border-color: transparent transparent $tooltip-bg transparent;
        top: -($tooltip-pip-size * 2);
        pointer-events: none;

        &.rtl {
          left: auto;
          #{$opposite-direction}: $tooltip-pip-size;
        }
      }

      &.radius {
        @include radius($tooltip-radius);
      }
      &.round {
        @include radius($tooltip-rounded);
        &>.nub {
          left: 2rem;
        }
      }

      &.opened {
        color: $has-tip-font-color-hover !important;
        border-bottom: $has-tip-border-bottom-hover !important;
      }
    }

    .tap-to-close {
      display: block;
      font-size: $tooltip-close-font-size;
      color: $tooltip-close-font-color;
      font-weight: $tooltip-close-font-weight;
    }

    @media #{$small} {
      .tooltip {
        &>.nub {
          border-color: transparent transparent $tooltip-bg transparent;
          top: -($tooltip-pip-size * 2);
        }
        &.tip-top>.nub {
          border-color: $tooltip-bg transparent transparent transparent;
          top: auto;
          bottom: -($tooltip-pip-size * 2);
        }

        &.tip-left,
        &.tip-right { float: none !important; }

        &.tip-left>.nub {
          border-color: transparent transparent transparent $tooltip-bg;
          right: -($tooltip-pip-size * 2);
          left: auto;
          top: 50%;
          margin-top: -$tooltip-pip-size;
        }
        &.tip-right>.nub {
          border-color: transparent $tooltip-bg transparent transparent;
          right: auto;
          left: -($tooltip-pip-size * 2);
          top: 50%;
          margin-top: -$tooltip-pip-size;
        }

      }
    }

  }
}