perf(tagsColor): 如果没有配置标签色则使用默认颜色

This commit is contained in:
nineya 2023-12-06 19:36:18 +08:00
parent 5e0d301095
commit e6feff2e13
3 changed files with 4 additions and 4 deletions

View File

@ -15,9 +15,9 @@
<div class="tags-field">
<a th:each="tag : ${tags}" class="tags" th:href="${tag.status.permalink}">
<span class="tag" th:text="${tag.spec.displayName}"
th:style="${enableTagsColor? 'color: ' + tag.spec.color +'; background: ' + tag.spec.color +'20' : ''}"></span>
th:style="${(enableTagsColor && tag.spec.color != '#ffffff')? 'color: ' + tag.spec.color +'; background: ' + tag.spec.color +'20' : ''}"></span>
<span class="tag is-grey" th:text="${tag.postCount}"
th:style="${enableTagsColor? 'background: ' + tag.spec.color +'CC' : ''}"></span>
th:style="${(enableTagsColor && tag.spec.color != '#ffffff')? 'background: ' + tag.spec.color +'CC' : ''}"></span>
</a>
</div>
</div>

View File

@ -17,6 +17,6 @@
th:href="@{${tag.status.permalink}}"
th:text="${tag.spec.displayName}"
th:with="size = ${#strings.length(tag.spec.displayName) + #strings.length(tag.spec.slug) + tag.postCount}"
th:style="'font-size: ' + ${size < 14 ? 14 : size > 32 ? 32 : size} + 'px;' + ${enableTagsColor? 'color: ' + tag.spec.color +';' : ''}"></a>
th:style="'font-size: ' + ${size < 14 ? 14 : size > 32 ? 32 : size} + 'px;' + ${(enableTagsColor && tag.spec.color != '#ffffff')? 'color: ' + tag.spec.color +';' : ''}"></a>
</div>
</div>

View File

@ -15,6 +15,6 @@
th:each="tag : ${tags}"
th:href="@{${tag.status.permalink}}"
th:text="${tag.spec.displayName}"
th:style="${enableTagsColor? 'color: ' + tag.spec.color +'; border-color: ' + tag.spec.color +'; background: ' + tag.spec.color +'20;' : ''}"></a>
th:style="${(enableTagsColor && tag.spec.color != '#ffffff')? 'color: ' + tag.spec.color +'; border-color: ' + tag.spec.color +'; background: ' + tag.spec.color +'20;' : ''}"></a>
</div>
</div>