4if (!defined(
'ISLOADEDBYSTEELSHEET')) {
5 die(
'Must be called by steelsheet');
10@phan-var-force string $badgePrimary
11@phan-var-force string $badgeSecondary
12@phan-var-force string $badgeSuccess
13@phan-var-force string $badgeDanger
14@phan-var-force string $badgeWarning
15@phan-var-force string $badgeInfo
16@phan-var-force string $badgeLight
17@phan-var-force string $badgeDark
18@phan-var-force string $colorblind_deuteranopes_badgeWarning
29 display:
inline-block;
32 font-weight: 700 !important;
36 vertical-align: baseline;
37 border-radius: .25rem;
38 transition: color .15s ease-in-out,background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out;
41 border-color: rgba(255,255,255,0);
42 box-sizing: border-box;
49.tabBar .arearef .statusref .badge-
status, .tabBar .arearefnobottom .statusref .badge-
status {
54@media only screen and (max-width: 767px)
56 .tabBar .arearef .statusref .badge-
status, .tabBar .arearefnobottom .statusref .badge-
status {
62.badge-pill, .tabs .badge {
65 border-radius: 0.25rem;
72 vertical-align: unset;
75a.badge:focus, a.badge:hover {
76 text-decoration: none;
79.liste_titre .badge:not(.nochangebackground) {
80 background-color: <?php print $badgeSecondary; ?>;
85 padding: 2px 7px 2px 7px;
86 background-color: #e4e4e4;
95 color: #fff !important;
96 background-color: <?php print $badgePrimary; ?>;
98a.badge-primary.focus, a.badge-primary:focus {
100 box-shadow: 0 0 0 0.2rem <?php print
colorHexToRgb($badgePrimary, 0.5); ?>;
102a.badge-primary:focus, a.badge-primary:hover {
103 color: #fff !important;
104 background-color: <?php print
colorDarker($badgePrimary, 10); ?>;
108.badge-secondary, .tabs .badge {
109 color: #fff !important;
110 background-color: <?php print $badgeSecondary; ?>;
112a.badge-secondary.focus, a.badge-secondary:focus {
114 box-shadow: 0 0 0 0.2rem <?php print
colorHexToRgb($badgeSecondary, 0.5); ?>;
116a.badge-secondary:focus, a.badge-secondary:hover {
117 color: #fff !important;
118 background-color: <?php print
colorDarker($badgeSecondary, 10); ?>;
123 color: #fff !important;
124 background-color: <?php print $badgeSuccess; ?>;
126a.badge-success.focus, a.badge-success:focus {
128 box-shadow: 0 0 0 0.2rem <?php print
colorHexToRgb($badgeSuccess, 0.5); ?>;
130a.badge-success:focus, a.badge-success:hover {
131 color: #fff !important;
132 background-color: <?php print
colorDarker($badgeSuccess, 10); ?>;
137 color: #fff !important;
138 background-color: <?php print $badgeDanger; ?>;
140a.badge-danger.focus, a.badge-danger:focus {
142 box-shadow: 0 0 0 0.2rem <?php print
colorHexToRgb($badgeDanger, 0.5); ?>;
144a.badge-danger:focus, a.badge-danger:hover {
145 color: #fff !important;
146 background-color: <?php print
colorDarker($badgeDanger, 10); ?>;
151 color: #fff !important;
152 background-color: <?php print $badgeWarning; ?>;
154a.badge-warning.focus, a.badge-warning:focus {
156 box-shadow: 0 0 0 0.2rem <?php print
colorHexToRgb($badgeWarning, 0.5); ?>;
158a.badge-warning:focus, a.badge-warning:hover {
159 color: #212529 !important;
160 background-color: <?php print
colorDarker($badgeWarning, 10); ?>;
164body[
class*=
"colorblind-"] .badge-warning {
165 background-color: <?php print $colorblind_deuteranopes_badgeWarning; ?>;
167body[
class*=
"colorblind-"] a.badge-warning.focus,body[
class^=
"colorblind-"] a.badge-warning:focus {
168 box-shadow: 0 0 0 0.2rem <?php print
colorHexToRgb($colorblind_deuteranopes_badgeWarning, 0.5); ?>;
170body[
class*=
"colorblind-"] a.badge-warning:focus, a.badge-warning:hover {
171 background-color: <?php print
colorDarker($colorblind_deuteranopes_badgeWarning, 10); ?>;
176 color: #fff !important;
177 background-color: <?php print $badgeInfo; ?>;
179a.badge-info.focus, a.badge-info:focus {
181 box-shadow: 0 0 0 0.2rem <?php print
colorHexToRgb($badgeInfo, 0.5); ?>;
183a.badge-info:focus, a.badge-info:hover {
184 color: #fff !important;
185 background-color: <?php print
colorDarker($badgeInfo, 10); ?>;
190 color: #212529 !important;
191 background-color: <?php print $badgeLight; ?>;
193a.badge-light.focus, a.badge-light:focus {
195 box-shadow: 0 0 0 0.2rem <?php print
colorHexToRgb($badgeLight, 0.5); ?>;
197a.badge-light:focus, a.badge-light:hover {
198 color: #212529 !important;
199 background-color: <?php print
colorDarker($badgeLight, 10); ?>;
204 color: #fff !important;
205 background-color: <?php print $badgeDark; ?>;
207a.badge-dark.focus, a.badge-dark:focus {
209 box-shadow: 0 0 0 0.2rem <?php print
colorHexToRgb($badgeDark, 0.5); ?>;
211a.badge-dark:focus, a.badge-dark:hover {
212 color: #fff !important;
213 background-color: <?php print
colorDarker($badgeDark, 10); ?>;
217@media only screen and (max-width: 570px)
222 text-overflow: ellipsis;
229for ($i = 0; $i <= 10; $i++) {
231 _createStatusBadgeCss((
string) $i,
'',
"STATUS".$i);
234 _createStatusBadgeCss((
string) $i,
'colorblind_deuteranopes_',
"COLORBLIND STATUS".$i,
'body[class*="colorblind-"] ');
237_createStatusBadgeCss(
'1b',
'',
"STATUS1b");
238_createStatusBadgeCss(
'4b',
'',
"STATUS4b");
249function _createStatusBadgeCss($statusName, $statusVarNamePrefix =
'', $commentLabel =
'', $cssPrefix =
'')
251 global ${$statusVarNamePrefix.
'badgeStatus'.$statusName}, ${$statusVarNamePrefix.
'badgeStatus_textColor'.$statusName};
253 if (!empty(${$statusVarNamePrefix.
'badgeStatus'.$statusName})) {
254 print
"\n/* ".strtoupper($commentLabel).
" */\n";
256 $thisBadgeBackgroundColor = $thisBadgeBorderColor = ${$statusVarNamePrefix.
'badgeStatus'.$statusName};
259 $TBadgeBorderOnly = array(
'0',
'1b',
'3',
'4b',
'5',
'7',
'10');
260 $thisBadgeTextColor =
colorIsLight(${$statusVarNamePrefix.
'badgeStatus'.$statusName}) ?
'#212529' :
'#ffffff';
262 if (!empty(${$statusVarNamePrefix.
'badgeStatus_textColor'.$statusName})) {
263 $thisBadgeTextColor = ${$statusVarNamePrefix.
'badgeStatus_textColor'.$statusName};
266 if (in_array((
string) $statusName, $TBadgeBorderOnly)) {
267 $thisBadgeTextColor =
'#212529';
268 $thisBadgeBackgroundColor =
"#fff";
271 if (in_array((
string) $statusName, array(
'0',
'5',
'9'))) {
272 $thisBadgeTextColor =
'#999999';
274 if (in_array((
string) $statusName, array(
'6'))) {
275 $thisBadgeTextColor =
'#777777';
279 print $cssPrefix.
".badge-status".$statusName.
" {\n";
280 print
" color: ".$thisBadgeTextColor.
" !important;\n";
281 if (in_array((
string) $statusName, $TBadgeBorderOnly)) {
282 print
" border-color: ".$thisBadgeBorderColor.
" !important;\n";
284 if ($thisBadgeBackgroundColor !=
'') {
285 print
" background-color: ".$thisBadgeBackgroundColor.
" !important;\n";
289 print $cssPrefix.
".font-status".$statusName.
" {\n";
290 if ($thisBadgeBackgroundColor !=
'') {
291 print
" color: ".$thisBadgeBackgroundColor.
" !important;\n";
296 print $cssPrefix.
".badge-status".$statusName.
".focus, ".$cssPrefix.
".badge-status".$statusName.
":focus {\n";
297 print
" outline: 0;\n";
298 print
" box-shadow: 0 0 0 0.2rem ".colorHexToRgb($thisBadgeBackgroundColor, 0.5).
" !important;\n";
301 print $cssPrefix.
".badge-status".$statusName.
":focus, ".$cssPrefix.
".badge-status".$statusName.
":hover {\n";
302 print
" color: ".$thisBadgeTextColor.
" !important;\n";
304 if (in_array((
string) $statusName, $TBadgeBorderOnly)) {
305 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.