mirror of
https://github.com/flarum/framework.git
synced 2025-03-02 09:24:11 +08:00
fix: icon aligment for tag icons
This commit is contained in:
parent
96b8a97484
commit
5bcc9ff3f1
@ -2,7 +2,7 @@ export default function tagIcon(tag, attrs = {}, settings = {}) {
|
|||||||
const hasIcon = tag && tag.icon();
|
const hasIcon = tag && tag.icon();
|
||||||
const { useColor = true } = settings;
|
const { useColor = true } = settings;
|
||||||
|
|
||||||
attrs.className = hasIcon ? 'icon ' + tag.icon() + ' ' + (attrs.className || '') : 'icon TagIcon ' + (attrs.className || '');
|
attrs.className = 'icon TagIcon '+ (attrs.className || '') + ' ' + (hasIcon ? tag.icon() : 'default');
|
||||||
|
|
||||||
if (tag) {
|
if (tag) {
|
||||||
attrs.style = attrs.style || {};
|
attrs.style = attrs.style || {};
|
||||||
|
@ -1,14 +1,19 @@
|
|||||||
.TagIcon {
|
.TagIcon {
|
||||||
border-radius: @border-radius;
|
|
||||||
width: 16px;
|
width: 16px;
|
||||||
height: 16px;
|
height: 16px;
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
vertical-align: -3px;
|
|
||||||
margin-left: 1px;
|
margin-left: 1px;
|
||||||
background: @control-bg;
|
text-align: center;
|
||||||
|
font-size: 1rem;
|
||||||
|
|
||||||
&.untagged {
|
&.untagged {
|
||||||
border: 1px dotted @muted-color;
|
border: 1px dotted @muted-color;
|
||||||
background: transparent;
|
background: transparent;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
&.default {
|
||||||
|
border-radius: @border-radius;
|
||||||
|
background: @control-bg;
|
||||||
|
vertical-align: -3px;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user