make icon optional in textblob

This commit is contained in:
Richard Schreiber
2024-11-21 15:35:07 +01:00
parent 2ca22ef663
commit 4bc1adc5e2
2 changed files with 3 additions and 3 deletions

View File

@@ -30,7 +30,7 @@ def textblob(type, *args, **kwargs):
return format_html( return format_html(
'<span class="text-blob-{}">{}', '<span class="text-blob-{}">{}',
type or "info", type or "info",
"" if not kwargs["icon"] else format_html( "" if "icon" not in kwargs else format_html(
'<i class="fa fa-{}" aria-hidden="true"></i> ', '<i class="fa fa-{}" aria-hidden="true"></i> ',
kwargs["icon"] kwargs["icon"]
) )

View File

@@ -532,13 +532,13 @@ h2 .label {
.text-blob-success, .text-blob-info, .text-blob-warning, .text-blob-danger { .text-blob-success, .text-blob-info, .text-blob-warning, .text-blob-danger {
padding: 0 .5em; padding: 0 .4em;
border-radius: $border-radius-base; border-radius: $border-radius-base;
font-weight: bold; font-weight: bold;
white-space: nowrap; white-space: nowrap;
&:has(>.fa:first-child) { &:has(>.fa:first-child) {
padding-left: .3em; padding-left: .25em;
} }
} }
.text-blob-success { .text-blob-success {