-
Notifications
You must be signed in to change notification settings - Fork 70
/
AdminPageFramework_Form_View___CSS_ToolTip.php
199 lines (174 loc) · 6.07 KB
/
AdminPageFramework_Form_View___CSS_ToolTip.php
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
193
194
195
196
197
198
199
<?php
/**
* Admin Page Framework
*
* http://en.michaeluno.jp/admin-page-framework/
* Copyright (c) 2013-2016 Michael Uno; Licensed MIT
*
*/
/**
* Provides methods to return CSS rules for tool tip outputs embedded in forms.
*
* @since 3.7.0
* @package AdminPageFramework
* @subpackage Common/Form/View/CSS
* @internal
*/
class AdminPageFramework_Form_View___CSS_ToolTip extends AdminPageFramework_Form_View___CSS_Base {
/**
* @since 3.7.0
* @return string
* @see http://www.menucool.com/tooltip/css-tooltip
*/
protected function _get() {
return <<<CSSRULES
/* Inside Field Title */
th > label > span > .admin-page-framework-form-tooltip {
margin-top: 1px;
margin-left: 1em;
}
/* For admin page fields, put the ? icon to the right hand side */
.admin-page-framework-content th > .admin-page-framework-form-tooltip {
float: right;
}
.postbox-container th > .admin-page-framework-form-tooltip {
margin-left: 1em;
float: none;
}
/* Regular section titles have the `+` button and collapsible title bar has a triangle icon so give a left margin */
.admin-page-framework-section-title a.admin-page-framework-form-tooltip,
.admin-page-framework-collapsible-title a.admin-page-framework-form-tooltip {
margin-left: 1em;
}
.admin-page-framework-section-tab a.admin-page-framework-form-tooltip {
margin-left: 0.48em;
color: #BEBEBE;
vertical-align: middle;
}
.admin-page-framework-section-tab.nav-tab.active a.admin-page-framework-form-tooltip {
color: #BEBEBE;
}
/* Font sizees */
/* Question Mark (?) - we want it to be a little bit smaller than the title */
.admin-page-framework-section-title a.admin-page-framework-form-tooltip > span,
.admin-page-framework-collapsible-title a.admin-page-framework-form-tooltip > span {
font-size: inherit;
}
.admin-page-framework-form-tooltip > span {
font-size: 1.2em;
padding-top: 2px;
vertical-align: middle; /* Dashicon vertical alignment */
display: inline; /* for vertical-align to take effect */
}
/* Tip Contents - When it is placed inside h2, h3, h4, the tooltip text becomes large so avoid that */
.admin-page-framework-section-title a.admin-page-framework-form-tooltip > span.admin-page-framework-form-tooltip-content,
.admin-page-framework-collapsible-title a.admin-page-framework-form-tooltip > span.admin-page-framework-form-tooltip-content,
a.admin-page-framework-form-tooltip > .admin-page-framework-form-tooltip-content {
font-size: 13px;
font-weight: normal;
}
a.admin-page-framework-form-tooltip {
/* vertical-align: middle; @deprecated 3.8.7 Withtout this, the element aligns more in vertically center. */
outline: none;
text-decoration: none;
cursor: default;
color: #BEBEBE;
}
a.admin-page-framework-form-tooltip > .admin-page-framework-form-tooltip-content > .admin-page-framework-form-tooltip-title {
font-weight: bold;
}
a.admin-page-framework-form-tooltip strong {
line-height:30px;
}
a.admin-page-framework-form-tooltip:hover {
text-decoration: none;
}
a.admin-page-framework-form-tooltip > span.admin-page-framework-form-tooltip-content {
visibility: hidden;
position: absolute;
padding: 14px 20px 14px;
width: 320px;
line-height:16px;
color: #111;
border:1px solid #DCA;
background: #FFFFF4;
/* Fade-in-and-out Effect */
opacity:0;
transition: visibility 0.4s, opacity 0.4s linear;
/* Adjust the position of the tooltip here */
margin-top: -28px;
/* margin-left: 28px; */
margin-left: 8px;
/* High z-index is required to appear over the left side bar menu */
z-index: 100000;
}
a.admin-page-framework-form-tooltip:hover > span.admin-page-framework-form-tooltip-content{
visibility: visible;
opacity:1; /* Fade-in-and-out Effect */
}
/* Balloon Left Arrow */
a.admin-page-framework-form-tooltip:hover > span.admin-page-framework-form-tooltip-content::before {
content: ' ';
position: absolute;
top: 40%;
right: 100%; /* To the left of the tooltip */
margin-top: -5px;
border-width: 7px;
border-style: solid;
border-color: transparent #DCA transparent transparent;
}
a.admin-page-framework-form-tooltip:hover > span.admin-page-framework-form-tooltip-content::after {
content: ' ';
position: absolute;
top: 40%;
right: 100%; /* To the left of the tooltip */
margin-top: -4px;
border-width: 6px;
border-style: solid;
border-color: transparent #FFFFF4 transparent transparent;
}
/* Tooltip Box Shadow */
a.admin-page-framework-form-tooltip > span.admin-page-framework-form-tooltip-content {
border-radius:4px;
box-shadow: 5px 5px 8px #CCC;
-webkit-box-shadow: 5px 5px 8px rgba(0, 0, 0, 0.2);
-moz-box-shadow: 5px 5px 8px rgba(0, 0, 0, 0.2);
box-shadow: 5px 5px 8px rgba(0, 0, 0, 0.2);
}
/* Title */
.admin-page-framework-form-tooltip-title {
font-weight: bold;
display: block;
}
/* Debug Info - Field Arguments */
a.admin-page-framework-form-tooltip.debug-info-field-arguments > span.admin-page-framework-form-tooltip-content {
width: 640px;
background-color: #F8F8F8;
}
a.admin-page-framework-form-tooltip.debug-info-field-arguments > span.admin-page-framework-form-tooltip-content .dump-array {
max-height: 400px;
margin: 20px 8px;
}
a.admin-page-framework-form-tooltip.debug-info-field-arguments:hover > span.admin-page-framework-form-tooltip-content::before {
content: ' ';
position: absolute;
top: 36px;
right: 100%; /* To the left of the tooltip */
margin-top: -5px;
border-width: 8px;
border-style: solid;
border-color: transparent #DCA transparent transparent;
}
a.admin-page-framework-form-tooltip.debug-info-field-arguments:hover > span.admin-page-framework-form-tooltip-content::after {
content: ' ';
position: absolute;
top: 38px;
right: 100%; /* To the left of the tooltip */
margin-top: -5px;
border-width: 6px;
border-style: solid;
border-color: transparent #F8F8F8 transparent transparent;
}
CSSRULES;
}
}