5if (!defined(
'ISLOADEDBYSTEELSHEET')) {
6 die(
'Must be called by steelsheet');
22@phan-var-force string $badgePrimary
23@phan-var-force string $badgeSecondary
24@phan-var-force string $badgeSuccess
25@phan-var-force string $badgeDanger
26@phan-var-force string $badgeWarning
27@phan-var-force string $badgeInfo
28@phan-var-force string $badgeLight
29@phan-var-force string $badgeDark
30@phan-var-force string $colorblind_deuteranopes_badgeWarning
39 display:
inline-block;
42 font-weight: 700 !important;
46 vertical-align: baseline;
47 border-radius: .25rem;
48 transition: color .15s ease-in-out,background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out;
51 border-color: rgba(255,255,255,0);
52 box-sizing: border-box;
59.tabBar .arearef .statusref .badge-
status, .tabBar .arearefnobottom .statusref .badge-
status {
64@media only screen and (max-width: 767px)
66 .tabBar .arearef .statusref .badge-
status, .tabBar .arearefnobottom .statusref .badge-
status {
75 border-radius: 0.25rem;
82 border-radius: 0.5rem;
89 vertical-align: text-top;
92a.badge:focus, a.badge:hover {
93 text-decoration: none;
96.liste_titre .badge:not(.nochangebackground) {
97 background-color: <?php print $badgeSecondary; ?>;
102 padding: 2px 7px 2px 7px;
103 background-color: #e4e4e4;
112 color: #fff !important;
113 background-color: <?php print $badgePrimary; ?>;
115a.badge-primary.focus, a.badge-primary:focus {
117 box-shadow: 0 0 0 0.2rem <?php print
colorHexToRgb($badgePrimary, 0.5); ?>;
119a.badge-primary:focus, a.badge-primary:hover {
120 color: #fff !important;
121 background-color: <?php print
colorDarker($badgePrimary, 10); ?>;
125.badge-secondary, .tabs .badge {
126 color: #fff !important;
127 background-color: <?php print $badgeSecondary; ?>;
129a.badge-secondary.focus, a.badge-secondary:focus {
131 box-shadow: 0 0 0 0.2rem <?php print
colorHexToRgb($badgeSecondary, 0.5); ?>;
133a.badge-secondary:focus, a.badge-secondary:hover {
134 color: #fff !important;
135 background-color: <?php print
colorDarker($badgeSecondary, 10); ?>;
140 color: #fff !important;
141 background-color: <?php print $badgeSuccess; ?>;
143a.badge-success.focus, a.badge-success:focus {
145 box-shadow: 0 0 0 0.2rem <?php print
colorHexToRgb($badgeSuccess, 0.5); ?>;
147a.badge-success:focus, a.badge-success:hover {
148 color: #fff !important;
149 background-color: <?php print
colorDarker($badgeSuccess, 10); ?>;
154 color: #fff !important;
155 background-color: <?php print $badgeDanger; ?>;
157a.badge-danger.focus, a.badge-danger:focus {
159 box-shadow: 0 0 0 0.2rem <?php print
colorHexToRgb($badgeDanger, 0.5); ?>;
161a.badge-danger:focus, a.badge-danger:hover {
162 color: #fff !important;
163 background-color: <?php print
colorDarker($badgeDanger, 10); ?>;
168 color: #fff !important;
169 background-color: <?php print $badgeWarning; ?>;
171a.badge-warning.focus, a.badge-warning:focus {
173 box-shadow: 0 0 0 0.2rem <?php print
colorHexToRgb($badgeWarning, 0.5); ?>;
175a.badge-warning:focus, a.badge-warning:hover {
176 color: #212529 !important;
177 background-color: <?php print
colorDarker($badgeWarning, 10); ?>;
181body[
class*=
"colorblind-"] .badge-warning {
182 background-color: <?php print $colorblind_deuteranopes_badgeWarning; ?>;
184body[
class*=
"colorblind-"] a.badge-warning.focus,body[
class^=
"colorblind-"] a.badge-warning:focus {
185 box-shadow: 0 0 0 0.2rem <?php print
colorHexToRgb($colorblind_deuteranopes_badgeWarning, 0.5); ?>;
187body[
class*=
"colorblind-"] a.badge-warning:focus, a.badge-warning:hover {
188 background-color: <?php print
colorDarker($colorblind_deuteranopes_badgeWarning, 10); ?>;
193 color: #fff !important;
194 background-color: <?php print $badgeInfo; ?>;
196a.badge-info.focus, a.badge-info:focus {
198 box-shadow: 0 0 0 0.2rem <?php print
colorHexToRgb($badgeInfo, 0.5); ?>;
200a.badge-info:focus, a.badge-info:hover {
201 color: #fff !important;
202 background-color: <?php print
colorDarker($badgeInfo, 10); ?>;
207 color: #212529 !important;
208 background-color: <?php print $badgeLight; ?>;
210a.badge-light.focus, a.badge-light:focus {
212 box-shadow: 0 0 0 0.2rem <?php print
colorHexToRgb($badgeLight, 0.5); ?>;
214a.badge-light:focus, a.badge-light:hover {
215 color: #212529 !important;
216 background-color: <?php print
colorDarker($badgeLight, 10); ?>;
221 color: #fff !important;
222 background-color: <?php print $badgeDark; ?>;
224a.badge-dark.focus, a.badge-dark:focus {
226 box-shadow: 0 0 0 0.2rem <?php print
colorHexToRgb($badgeDark, 0.5); ?>;
228a.badge-dark:focus, a.badge-dark:hover {
229 color: #fff !important;
230 background-color: <?php print
colorDarker($badgeDark, 10); ?>;
234@media only screen and (max-width: 570px)
239 text-overflow: ellipsis;
246for ($i = 0; $i <= 10; $i++) {
248 _createStatusBadgeCss((
string) $i,
'',
"STATUS".$i);
251 _createStatusBadgeCss((
string) $i,
'colorblind_deuteranopes_',
"COLORBLIND STATUS".$i,
'body[class*="colorblind-"] ');
254_createStatusBadgeCss(
'1b',
'',
"STATUS1b");
255_createStatusBadgeCss(
'4b',
'',
"STATUS4b");
269function _createStatusBadgeCss($statusName, $statusVarNamePrefix =
'', $commentLabel =
'', $cssPrefix =
'')
271 global ${$statusVarNamePrefix.
'badgeStatus'.$statusName}, ${$statusVarNamePrefix.
'badgeStatus_textColor'.$statusName};
273 if (!empty(${$statusVarNamePrefix.
'badgeStatus'.$statusName})) {
274 print
"\n/* ".strtoupper($commentLabel).
" - ".$statusName.
" */\n";
276 $thisBadgeBackgroundColor = $thisBadgeBorderColor = ${$statusVarNamePrefix.
'badgeStatus'.$statusName};
278 $TBadgeBorderOnly = array(
'0',
'1b',
'3',
'4b',
'5',
'7',
'10');
279 $thisBadgeTextColor =
colorIsLight(${$statusVarNamePrefix.
'badgeStatus'.$statusName}) ?
'#212529' :
'#ffffff';
281 if (!empty(${$statusVarNamePrefix.
'badgeStatus_textColor'.$statusName})) {
282 $thisBadgeTextColor = ${$statusVarNamePrefix.
'badgeStatus_textColor'.$statusName};
285 if (in_array((
string) $statusName, $TBadgeBorderOnly)) {
286 $thisBadgeTextColor =
'#9c850b';
287 $thisBadgeBackgroundColor =
"hsl(0, 0%, 0%, 0)";
290 if (in_array((
string) $statusName, array(
'4b',
'7'))) {
291 $thisBadgeTextColor =
'#25a580';
293 if (in_array((
string) $statusName, array(
'0',
'5',
'9',
'10'))) {
294 $thisBadgeTextColor =
'#999999';
296 if (in_array((
string) $statusName, array(
'6'))) {
297 $thisBadgeTextColor =
'#777777';
301 print $cssPrefix.
".badge-status".$statusName.
" {\n";
302 print
" color: ".$thisBadgeTextColor.
" !important;\n";
303 if (in_array((
string) $statusName, $TBadgeBorderOnly)) {
304 print
" border-color: ".$thisBadgeBorderColor.
" !important;\n";
306 if ($thisBadgeBackgroundColor !=
'') {
307 print
" background-color: ".$thisBadgeBackgroundColor.
" !important;\n";
311 print $cssPrefix.
".font-status".$statusName.
" {\n";
312 if ($thisBadgeBackgroundColor !=
'') {
313 print
" color: ".$thisBadgeBackgroundColor.
" !important;\n";
319 print $cssPrefix.
".badge-status".$statusName.
".focus, ".$cssPrefix.
".badge-status".$statusName.
":focus {\n";
320 print
" outline: 0;\n";
321 print
" box-shadow: 0 0 0 0.2rem ".colorHexToRgb($thisBadgeBackgroundColor, 0.5).
" !important;\n";
324 print $cssPrefix.
".badge-status".$statusName.
":focus, ".$cssPrefix.
".badge-status".$statusName.
":hover {\n";
325 print
" color: ".$thisBadgeTextColor.
" !important;\n";
326 if (in_array((
string) $statusName, $TBadgeBorderOnly)) {
327 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.