summaryrefslogtreecommitdiff
path: root/templates/assets/tether/src/css/helpers/_tether-theme-arrows.sass
blob: 55f2463e8a57121cbd8b8e75cc58478045a840fc (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
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
=tether-theme-arrows($themePrefix: "tether", $themeName: "arrows", $arrowSize: 16px, $arrowPointerEvents: null, $backgroundColor: #fff, $color: inherit, $useDropShadow: false)
    .#{ $themePrefix }-element.#{ $themePrefix }-theme-#{ $themeName }
        max-width: 100%
        max-height: 100%

        .#{ $themePrefix }-content
            border-radius: 5px
            position: relative
            font-family: inherit
            background: $backgroundColor
            color: $color
            padding: 1em
            font-size: 1.1em
            line-height: 1.5em

            @if $useDropShadow
                transform: translateZ(0)
                filter: drop-shadow(0 1px 4px rgba(0, 0, 0, .2))

            &:before
                content: ""
                display: block
                position: absolute
                width: 0
                height: 0
                border-color: transparent
                border-width: $arrowSize
                border-style: solid
                pointer-events: $arrowPointerEvents

        // Centers and middles

        &.#{ $themePrefix }-element-attached-bottom.#{ $themePrefix }-element-attached-center .#{ $themePrefix }-content
            margin-bottom: $arrowSize

            &:before
                top: 100%
                left: 50%
                margin-left: - $arrowSize
                border-top-color: $backgroundColor
                border-bottom: 0

        &.#{ $themePrefix }-element-attached-top.#{ $themePrefix }-element-attached-center .#{ $themePrefix }-content
            margin-top: $arrowSize

            &:before
                bottom: 100%
                left: 50%
                margin-left: - $arrowSize
                border-bottom-color: $backgroundColor
                border-top: 0

        &.#{ $themePrefix }-element-attached-right.#{ $themePrefix }-element-attached-middle .#{ $themePrefix }-content
            margin-right: $arrowSize

            &:before
                left: 100%
                top: 50%
                margin-top: - $arrowSize
                border-left-color: $backgroundColor
                border-right: 0

        &.#{ $themePrefix }-element-attached-left.#{ $themePrefix }-element-attached-middle .#{ $themePrefix }-content
            margin-left: $arrowSize

            &:before
                right: 100%
                top: 50%
                margin-top: - $arrowSize
                border-right-color: $backgroundColor
                border-left: 0

        // Target middle/center, element corner

        &.#{ $themePrefix }-element-attached-left.#{ $themePrefix }-target-attached-center .#{ $themePrefix }-content
            left: - $arrowSize * 2

        &.#{ $themePrefix }-element-attached-right.#{ $themePrefix }-target-attached-center .#{ $themePrefix }-content
            left: $arrowSize * 2

        &.#{ $themePrefix }-element-attached-top.#{ $themePrefix }-element-attached-left.#{ $themePrefix }-target-attached-middle .#{ $themePrefix }-content
            margin-top: $arrowSize

            &:before
                bottom: 100%
                left: $arrowSize
                border-bottom-color: $backgroundColor
                border-top: 0

        &.#{ $themePrefix }-element-attached-top.#{ $themePrefix }-element-attached-right.#{ $themePrefix }-target-attached-middle .#{ $themePrefix }-content
            margin-top: $arrowSize

            &:before
                bottom: 100%
                right: $arrowSize
                border-bottom-color: $backgroundColor
                border-top: 0

        &.#{ $themePrefix }-element-attached-bottom.#{ $themePrefix }-element-attached-left.#{ $themePrefix }-target-attached-middle .#{ $themePrefix }-content
            margin-bottom: $arrowSize

            &:before
                top: 100%
                left: $arrowSize
                border-top-color: $backgroundColor
                border-bottom: 0

        &.#{ $themePrefix }-element-attached-bottom.#{ $themePrefix }-element-attached-right.#{ $themePrefix }-target-attached-middle .#{ $themePrefix }-content
            margin-bottom: $arrowSize

            &:before
                top: 100%
                right: $arrowSize
                border-top-color: $backgroundColor
                border-bottom: 0


        // Top and bottom corners

        &.#{ $themePrefix }-element-attached-top.#{ $themePrefix }-element-attached-left.#{ $themePrefix }-target-attached-bottom .#{ $themePrefix }-content
            margin-top: $arrowSize

            &:before
                bottom: 100%
                left: $arrowSize
                border-bottom-color: $backgroundColor
                border-top: 0

        &.#{ $themePrefix }-element-attached-top.#{ $themePrefix }-element-attached-right.#{ $themePrefix }-target-attached-bottom .#{ $themePrefix }-content
            margin-top: $arrowSize

            &:before
                bottom: 100%
                right: $arrowSize
                border-bottom-color: $backgroundColor
                border-top: 0

        &.#{ $themePrefix }-element-attached-bottom.#{ $themePrefix }-element-attached-left.#{ $themePrefix }-target-attached-top .#{ $themePrefix }-content
            margin-bottom: $arrowSize

            &:before
                top: 100%
                left: $arrowSize
                border-top-color: $backgroundColor
                border-bottom: 0

        &.#{ $themePrefix }-element-attached-bottom.#{ $themePrefix }-element-attached-right.#{ $themePrefix }-target-attached-top .#{ $themePrefix }-content
            margin-bottom: $arrowSize

            &:before
                top: 100%
                right: $arrowSize
                border-top-color: $backgroundColor
                border-bottom: 0

        // Side corners

        &.#{ $themePrefix }-element-attached-top.#{ $themePrefix }-element-attached-right.#{ $themePrefix }-target-attached-left .#{ $themePrefix }-content
            margin-right: $arrowSize

            &:before
                top: $arrowSize
                left: 100%
                border-left-color: $backgroundColor
                border-right: 0

        &.#{ $themePrefix }-element-attached-top.#{ $themePrefix }-element-attached-left.#{ $themePrefix }-target-attached-right .#{ $themePrefix }-content
            margin-left: $arrowSize

            &:before
                top: $arrowSize
                right: 100%
                border-right-color: $backgroundColor
                border-left: 0

        &.#{ $themePrefix }-element-attached-bottom.#{ $themePrefix }-element-attached-right.#{ $themePrefix }-target-attached-left .#{ $themePrefix }-content
            margin-right: $arrowSize

            &:before
                bottom: $arrowSize
                left: 100%
                border-left-color: $backgroundColor
                border-right: 0

        &.#{ $themePrefix }-element-attached-bottom.#{ $themePrefix }-element-attached-left.#{ $themePrefix }-target-attached-right .#{ $themePrefix }-content
            margin-left: $arrowSize

            &:before
                bottom: $arrowSize
                right: 100%
                border-right-color: $backgroundColor
                border-left: 0