Skip to content

Commit

Permalink
Make problem badges a bit wider by default so they have the same size.
Browse files Browse the repository at this point in the history
  • Loading branch information
nickygerritsen authored and mpsijm committed May 28, 2024
1 parent f47ff24 commit e0f9a03
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion webapp/public/style_domjudge.css
Original file line number Diff line number Diff line change
Expand Up @@ -618,7 +618,9 @@ tr.ignore td, td.ignore, span.ignore {
}

.problem-badge {
font-size: 100%;
--badge-padding-x: 0.5em;
font-size: 1em;
min-width: 2em;
}

.tooltip .tooltip-inner {
Expand Down
2 changes: 1 addition & 1 deletion webapp/src/Twig/TwigExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -1085,7 +1085,7 @@ public function problemBadge(ContestProblem $problem): string
// Pick the foreground text color based on the background color.
$foreground = ($background[0] + $background[1] + $background[2] > 450) ? '#000000' : '#ffffff';
return sprintf(
'<span class="badge problem-badge" style="background-color: %s; min-width: 28px; border: 1px solid %s"><span style="color: %s;">%s</span></span>',
'<span class="badge problem-badge" style="background-color: %s; border: 1px solid %s"><span style="color: %s;">%s</span></span>',
$rgb,
$border,
$foreground,
Expand Down

0 comments on commit e0f9a03

Please sign in to comment.