5if (!defined(
'ISLOADEDBYSTEELSHEET')) {
6 die(
'Must be call by steelsheet');
20@phan-var-force string $badgePrimary
21@phan-var-force string $badgeSecondary
22@phan-var-force string $badgeSuccess
23@phan-var-force string $badgeDanger
24@phan-var-force string $badgeWarning
25@phan-var-force string $badgeInfo
26@phan-var-force string $badgeLight
27@phan-var-force string $badgeDark
28@phan-var-force string $colorblind_deuteranopes_badgeWarning
37 display:
inline-block;
40 font-weight: 700 !important;
44 vertical-align: baseline;
45 border-radius: .25rem;
46 transition: color .15s ease-in-out,background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out;
49 border-color: rgba(255,255,255,0);
50 box-sizing: border-box;
57.tabBar .arearef .statusref .badge-
status, .tabBar .arearefnobottom .statusref .badge-
status {
62@media only screen and (max-width: 767px)
64 .tabBar .arearef .statusref .badge-
status, .tabBar .arearefnobottom .statusref .badge-
status {
70.badge-pill, .tabs .badge {
73 border-radius: 0.25rem;
80 vertical-align: text-top;
83a.badge:focus, a.badge:hover {
84 text-decoration: none;
87.liste_titre .badge:not(.nochangebackground) {
88 background-color: <?php print $badgeSecondary; ?>;
93 padding: 2px 7px 2px 7px;
94 background-color: #e4e4e4;
103 color: #fff !important;
104 background-color: <?php print $badgePrimary; ?>;
106a.badge-primary.focus, a.badge-primary:focus {
108 box-shadow: 0 0 0 0.2rem <?php print
colorHexToRgb($badgePrimary, 0.5); ?>;
110a.badge-primary:focus, a.badge-primary:hover {
111 color: #fff !important;
112 background-color: <?php print
colorDarker($badgePrimary, 10); ?>;
116.badge-secondary, .tabs .badge {
117 color: #fff !important;
118 background-color: <?php print $badgeSecondary; ?>;
120a.badge-secondary.focus, a.badge-secondary:focus {
122 box-shadow: 0 0 0 0.2rem <?php print
colorHexToRgb($badgeSecondary, 0.5); ?>;
124a.badge-secondary:focus, a.badge-secondary:hover {
125 color: #fff !important;
126 background-color: <?php print
colorDarker($badgeSecondary, 10); ?>;
131 color: #fff !important;
132 background-color: <?php print $badgeSuccess; ?>;
134a.badge-success.focus, a.badge-success:focus {
136 box-shadow: 0 0 0 0.2rem <?php print
colorHexToRgb($badgeSuccess, 0.5); ?>;
138a.badge-success:focus, a.badge-success:hover {
139 color: #fff !important;
140 background-color: <?php print
colorDarker($badgeSuccess, 10); ?>;
145 color: #fff !important;
146 background-color: <?php print $badgeDanger; ?>;
148a.badge-danger.focus, a.badge-danger:focus {
150 box-shadow: 0 0 0 0.2rem <?php print
colorHexToRgb($badgeDanger, 0.5); ?>;
152a.badge-danger:focus, a.badge-danger:hover {
153 color: #fff !important;
154 background-color: <?php print
colorDarker($badgeDanger, 10); ?>;
159 color: #fff !important;
160 background-color: <?php print $badgeWarning; ?>;
162a.badge-warning.focus, a.badge-warning:focus {
164 box-shadow: 0 0 0 0.2rem <?php print
colorHexToRgb($badgeWarning, 0.5); ?>;
166a.badge-warning:focus, a.badge-warning:hover {
167 color: #212529 !important;
168 background-color: <?php print
colorDarker($badgeWarning, 10); ?>;
172body[
class*=
"colorblind-"] .badge-warning {
173 background-color: <?php print $colorblind_deuteranopes_badgeWarning; ?>;
175body[
class*=
"colorblind-"] a.badge-warning.focus,body[
class^=
"colorblind-"] a.badge-warning:focus {
176 box-shadow: 0 0 0 0.2rem <?php print
colorHexToRgb($colorblind_deuteranopes_badgeWarning, 0.5); ?>;
178body[
class*=
"colorblind-"] a.badge-warning:focus, a.badge-warning:hover {
179 background-color: <?php print
colorDarker($colorblind_deuteranopes_badgeWarning, 10); ?>;
184 color: #fff !important;
185 background-color: <?php print $badgeInfo; ?>;
187a.badge-info.focus, a.badge-info:focus {
189 box-shadow: 0 0 0 0.2rem <?php print
colorHexToRgb($badgeInfo, 0.5); ?>;
191a.badge-info:focus, a.badge-info:hover {
192 color: #fff !important;
193 background-color: <?php print
colorDarker($badgeInfo, 10); ?>;
198 color: #212529 !important;
199 background-color: <?php print $badgeLight; ?>;
201a.badge-light.focus, a.badge-light:focus {
203 box-shadow: 0 0 0 0.2rem <?php print
colorHexToRgb($badgeLight, 0.5); ?>;
205a.badge-light:focus, a.badge-light:hover {
206 color: #212529 !important;
207 background-color: <?php print
colorDarker($badgeLight, 10); ?>;
212 color: #fff !important;
213 background-color: <?php print $badgeDark; ?>;
215a.badge-dark.focus, a.badge-dark:focus {
217 box-shadow: 0 0 0 0.2rem <?php print
colorHexToRgb($badgeDark, 0.5); ?>;
219a.badge-dark:focus, a.badge-dark:hover {
220 color: #fff !important;
221 background-color: <?php print
colorDarker($badgeDark, 10); ?>;
225@media only screen and (max-width: 570px)
230 text-overflow: ellipsis;
237for ($i = 0; $i <= 10; $i++) {
239 _createStatusBadgeCss((
string) $i,
'',
"STATUS".$i);
242 _createStatusBadgeCss((
string) $i,
'colorblind_deuteranopes_',
"COLORBLIND STATUS".$i,
'body[class*="colorblind-"] ');
245_createStatusBadgeCss(
'1b',
'',
"STATUS1b");
246_createStatusBadgeCss(
'4b',
'',
"STATUS4b");
258function _createStatusBadgeCss($statusName, $statusVarNamePrefix =
'', $commentLabel =
'', $cssPrefix =
'')
260 global ${$statusVarNamePrefix.
'badgeStatus'.$statusName}, ${$statusVarNamePrefix.
'badgeStatus_textColor'.$statusName};
262 if (!empty(${$statusVarNamePrefix.
'badgeStatus'.$statusName})) {
263 print
"\n/* ".strtoupper($commentLabel).
" */\n";
265 $thisBadgeBackgroundColor = $thisBadgeBorderColor = ${$statusVarNamePrefix.
'badgeStatus'.$statusName};
267 $TBadgeBorderOnly = array(
'0',
'1b',
'3',
'4b',
'5',
'7',
'10');
268 $thisBadgeTextColor =
colorIsLight(${$statusVarNamePrefix.
'badgeStatus'.$statusName}) ?
'#212529' :
'#ffffff';
270 if (!empty(${$statusVarNamePrefix.
'badgeStatus_textColor'.$statusName})) {
271 $thisBadgeTextColor = ${$statusVarNamePrefix.
'badgeStatus_textColor'.$statusName};
274 if (in_array((
string) $statusName, $TBadgeBorderOnly)) {
275 $thisBadgeTextColor =
'#212529';
276 $thisBadgeBackgroundColor =
"";
279 if (in_array((
string) $statusName, array(
'0',
'5',
'9'))) {
280 $thisBadgeTextColor =
'#999999';
282 if (in_array((
string) $statusName, array(
'6'))) {
283 $thisBadgeTextColor =
'#777777';
287 print $cssPrefix.
".badge-status".$statusName.
" {\n";
288 print
" color: ".$thisBadgeTextColor.
" !important;\n";
289 if (in_array((
string) $statusName, $TBadgeBorderOnly)) {
290 print
" border-color: ".$thisBadgeBorderColor.
" !important;\n";
292 if ($thisBadgeBackgroundColor !=
'') {
293 print
" background-color: ".$thisBadgeBackgroundColor.
" !important;\n";
297 print $cssPrefix.
".font-status".$statusName.
" {\n";
298 if ($thisBadgeBackgroundColor !=
'') {
299 print
" color: ".$thisBadgeBackgroundColor.
" !important;\n";
303 print $cssPrefix.
".badge-status".$statusName.
".focus, ".$cssPrefix.
".badge-status".$statusName.
":focus {\n";
304 print
" outline: 0;\n";
305 print
" box-shadow: 0 0 0 0.2rem ".colorHexToRgb($thisBadgeBackgroundColor, 0.5).
" !important;\n";
309 print $cssPrefix.
".badge-status".$statusName.
":focus, ".$cssPrefix.
".badge-status".$statusName.
":hover {\n";
310 print
" color: ".$thisBadgeTextColor.
" !important;\n";
312 if (in_array((
string) $statusName, $TBadgeBorderOnly)) {
313 print
" border-color: ".colorDarker($thisBadgeBorderColor, 10).
" !important;\n";
print $langs trans("Ref").' m titre as m m statut as status
Or an array listing all the potential status of the object: array: int of the status => translated la...
colorHexToRgb($hex, $alpha=false, $returnArray=false)
colorDarker($hex, $percent)
colorIsLight($stringcolor)
Return true if the color is light.