Merge pull request #76 from flarum/ds/fix-align-color-issues

Fix alignments and checked colors in TagDiscussionModal
This commit is contained in:
Daniël Klabbers 2020-02-26 11:40:16 +01:00 committed by GitHub
commit 9a17784600
3 changed files with 22 additions and 11 deletions

View File

@ -1,8 +1,14 @@
import classList from 'flarum/utils/classList';
export default function tagIcon(tag, attrs = {}, settings = {}) {
const hasIcon = tag && tag.icon();
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) {
attrs.style = attrs.style || {};

View File

@ -1,19 +1,14 @@
.TagIcon {
border-radius: @border-radius;
width: 16px;
height: 16px;
display: inline-block;
vertical-align: -3px;
margin-left: 1px;
text-align: center;
font-size: 1rem;
background: @control-bg;
&.untagged {
border: 1px dotted @muted-color;
background: transparent;
}
&.default {
border-radius: @border-radius;
background: @control-bg;
vertical-align: -3px;
}
}

View File

@ -107,15 +107,24 @@
&.active {
background: @control-bg;
}
.icon::before {
display: inline-block;
width: 16px;
text-align: center;
vertical-align: middle;
}
&.selected {
.icon::before {
.fa();
content: @fa-var-check !important;
color: @muted-color !important;
color: @muted-color;
font-size: 14px;
width: 100%;
text-align: center;
vertical-align: 1px;
}
&.colored .TagIcon:before {
color: #fff;
}
@ -123,6 +132,7 @@
.TagIcon {
vertical-align: top;
margin-top: 3px;
margin-left: 0;
}
}
}