mirror of
https://github.com/flarum/core.git
synced 2025-08-15 21:04:30 +02:00
@@ -1,8 +1,14 @@
|
|||||||
|
import classList from 'flarum/utils/classList';
|
||||||
|
|
||||||
export default function tagIcon(tag, attrs = {}, settings = {}) {
|
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 = 'icon TagIcon '+ (attrs.className || '') + ' ' + (hasIcon ? tag.icon() : 'default');
|
attrs.className = classList([
|
||||||
|
attrs.className,
|
||||||
|
'icon',
|
||||||
|
hasIcon ? tag.icon() : 'TagIcon'
|
||||||
|
]);
|
||||||
|
|
||||||
if (tag) {
|
if (tag) {
|
||||||
attrs.style = attrs.style || {};
|
attrs.style = attrs.style || {};
|
||||||
|
@@ -1,19 +1,14 @@
|
|||||||
.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;
|
||||||
text-align: center;
|
background: @control-bg;
|
||||||
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;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@@ -107,15 +107,24 @@
|
|||||||
&.active {
|
&.active {
|
||||||
background: @control-bg;
|
background: @control-bg;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.icon::before {
|
||||||
|
display: inline-block;
|
||||||
|
width: 16px;
|
||||||
|
text-align: center;
|
||||||
|
vertical-align: middle;
|
||||||
|
}
|
||||||
|
|
||||||
&.selected {
|
&.selected {
|
||||||
.icon::before {
|
.icon::before {
|
||||||
.fa();
|
.fa();
|
||||||
content: @fa-var-check !important;
|
content: @fa-var-check !important;
|
||||||
color: @muted-color !important;
|
color: @muted-color;
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
width: 100%;
|
|
||||||
text-align: center;
|
text-align: center;
|
||||||
|
vertical-align: 1px;
|
||||||
}
|
}
|
||||||
|
|
||||||
&.colored .TagIcon:before {
|
&.colored .TagIcon:before {
|
||||||
color: #fff;
|
color: #fff;
|
||||||
}
|
}
|
||||||
@@ -123,6 +132,7 @@
|
|||||||
.TagIcon {
|
.TagIcon {
|
||||||
vertical-align: top;
|
vertical-align: top;
|
||||||
margin-top: 3px;
|
margin-top: 3px;
|
||||||
|
margin-left: 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user