Tagify in Dark Mode

I have my main project theme switcher working well mostly. However Tagify is unusable in dark mode. I assume I can change this by adding a CSS rule to my style sheet but I am having trouble finding the right CSS class.

It changes the text to a light color but does not change the background. Making It very hard to read.

I have tried:

[data-bs-theme=dark] .tagify__dropdown {
    color: #eceeec;
    background-color: #196d87;
  }

I use this. You probably don't need all of it, but hopefully it helps.

I use a form-control class on the tagify element, plus the dark-mode class on the body tag, so you'll need to replace the dark-mode for [data-bs-theme=dark]

<input class="form-control" is="dmx-tagify" id="labels" name="Label" dmx-bind:data="GetContactLabel.data.contactlabels" tag-text="Name" tag-value="LabelId" dmx-bind:value="data_detail_contact.data.FormattedLabels" min-chars="0" nocustom="true">
.dark-mode .form-control {
background: #141c26!important
border-color: #384d69!important
}

.dark-mode .form-control,.dark-mode .form-control:focus {
color: #fff!important
}

.dark-mode .form-control-select-multiple .form-select option {
color: #8094ae!important
}

.dark-mode .tagify__tag>div {
color: #b6c6e3
}

.tagify {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align: start;
        -ms-flex-align: start;
            align-items: flex-start;
    -ms-flex-wrap: wrap;
        flex-wrap: wrap;
    border: 1px solid #e5e9f2;
    padding: 3px;
    line-height: 1.1;
    cursor: text;
    outline: 0;
    position: relative;
    -webkit-transition: .1s;
    transition: .1s;
    font-size: 14px
}

@media (max-width: 576px) {
    .tagify {
        padding:4px;
        font-size: 12px
    }
}

.tagify:hover {
    border-color: #dbdfea
}

.tagify.tagify--focus {
    -webkit-transition: 0s;
    transition: 0s;
    border-color: #6576ff
}

.tagify[readonly] {
    cursor: default
}

.tagify[readonly]>.tagify__input {
    visibility: hidden;
    width: 0;
    margin: 5px 0
}

.tagify[readonly] .tagify__tag__removeBtn {
    display: none
}

.tagify[readonly] .tagify__tag>div {
    padding: .25rem .5rem .25rem .675rem
}

.tagify[readonly] .tagify__tag>div::before {
    background: linear-gradient(45deg,#fff 25%,transparent 25%,transparent 50%,#fff 50%,#fff 75%,transparent 75%,transparent) 0/5px 5px;
    -webkit-box-shadow: none;
            box-shadow: none;
    -webkit-filter: brightness(.95);
            filter: brightness(.95)
}

.tagify--loading .tagify__input::before {
    content: none
}

.tagify--loading .tagify__input::after {
    content: "";
    vertical-align: middle;
    margin: -2px 0 -2px .5em;
    opacity: 1;
    width: .7em;
    height: .7em;
    border: 3px solid;
    border-color: #eee #bbb #888 transparent;
    border-radius: 50%;
    -webkit-animation: rotateLoader .4s infinite linear;
            animation: rotateLoader .4s infinite linear
}

.tagify--loading .tagify__input:empty::after {
    margin-left: 0
}

.tagify+input,.tagify+textarea {
    visibility: hidden!important;
    position: absolute!important;
    pointer-events: none
}

.tagify__tag {
    display: -webkit-inline-box;
    display: -ms-inline-flexbox;
    display: inline-flex;
    -webkit-box-align: center;
        -ms-flex-align: center;
            align-items: center;
    margin: 2px;
    position: relative;
    z-index: 1;
    outline: 0;
    cursor: default;
    -webkit-transition: .13s ease-out;
    transition: .13s ease-out
}

.tagify__tag>div {
    vertical-align: top;
    -webkit-box-sizing: border-box;
            box-sizing: border-box;
    max-width: 100%;
    padding: .25rem .5rem .25rem .675rem;
    color: #526484;
    line-height: inherit;
    border-radius: 15px;
    -webkit-user-select: none;
       -moz-user-select: none;
        -ms-user-select: none;
            user-select: none;
    -webkit-transition: .13s ease-out;
    transition: .13s ease-out
}

.tagify__tag>div>* {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: inline-block;
    vertical-align: top;
    min-width: var(--tag--min-width);
    max-width: var(--tag--max-width);
    -webkit-transition: .8s ease,.1s color;
    transition: .8s ease,.1s color
}

.tagify__tag>div>[contenteditable] {
    outline: 0;
    -webkit-user-select: text;
       -moz-user-select: text;
        -ms-user-select: text;
            user-select: text;
    cursor: text;
    margin: -2px;
    padding: 2px;
    max-width: 350px
}

.tagify__tag>div::before {
    content: "";
    position: absolute;
    border-radius: inherit;
    left: 0;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: -1;
    pointer-events: none;
    -webkit-transition: 120ms ease;
    transition: 120ms ease;
    -webkit-box-shadow: 0 0 0 1.1em #fff inset;
            box-shadow: 0 0 0 1.1em #fff inset;
    border: 1px solid #e5e9f2
}

.tagify__tag:hover:not([readonly]) div::before {
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    -webkit-box-shadow: 0 0 0 1.1em #f5f6fa inset;
            box-shadow: 0 0 0 1.1em #f5f6fa inset
}

.tagify__tag.tagify--noAnim>div::before {
    -webkit-animation: none;
            animation: none
}

.tagify__tag.tagify--hide {
    width: 0!important;
    padding-left: 0;
    padding-right: 0;
    margin-left: 0;
    margin-right: 0;
    opacity: 0;
    -webkit-transform: scale(0);
            transform: scale(0);
    -webkit-transition: .3s;
    transition: .3s;
    pointer-events: none
}

.tagify__tag.tagify--mark div::before {
    -webkit-animation: none;
            animation: none
}

.tagify__tag.tagify--notAllowed:not(.tagify__tag--editable) div>span {
    opacity: .5
}

.tagify__tag.tagify--notAllowed:not(.tagify__tag--editable) div::before {
    -webkit-box-shadow: 0 0 0 1.1em rgba(114,128,146,.5) inset!important;
            box-shadow: 0 0 0 1.1em rgba(114,128,146,.5) inset!important;
    -webkit-transition: .2s;
    transition: .2s
}

.tagify__tag[readonly] .tagify__tag__removeBtn {
    display: none
}

.tagify__tag[readonly]>div::before {
    background: linear-gradient(45deg,#fff 25%,transparent 25%,transparent 50%,#fff 50%,#fff 75%,transparent 75%,transparent) 0/5px 5px;
    -webkit-box-shadow: none;
            box-shadow: none;
    -webkit-filter: brightness(.95);
            filter: brightness(.95);
    border-color: none
}

.tagify__tag--editable>div {
    color: #526484
}

.tagify__tag--editable>div::before {
    -webkit-box-shadow: 0 0 0 2px #f5f6fa inset!important;
            box-shadow: 0 0 0 2px #f5f6fa inset!important
}

.tagify__tag--editable.tagify--invalid>div::before {
    -webkit-box-shadow: 0 0 0 2px #728092 inset!important;
            box-shadow: 0 0 0 2px #728092 inset!important
}

.tagify__tag__removeBtn {
    -webkit-box-ordinal-group: 6;
        -ms-flex-order: 5;
            order: 5;
    display: -webkit-inline-box;
    display: -ms-inline-flexbox;
    display: inline-flex;
    -webkit-box-align: center;
        -ms-flex-align: center;
            align-items: center;
    -webkit-box-pack: center;
        -ms-flex-pack: center;
            justify-content: center;
    border-radius: 50px;
    cursor: pointer;
    font: 11px Nioicon;
    background: 0 0;
    color: #364a63;
    width: 14px;
    height: 14px;
    margin-right: 3.6666666667px;
    margin-left: -3.6666666667px;
    -webkit-transition: .2s ease-out;
    transition: .2s ease-out
}

.tagify__tag__removeBtn::after {
    position: relative;
    content: "\ea06";
    top: 0
}

.tagify__tag__removeBtn:hover {
    color: #fff;
    background: #606c7c
}

.tagify__tag__removeBtn:hover+div::before {
    -webkit-transition: .2s;
    transition: .2s
}

.tagify:not(.tagify--mix) .tagify__input br {
    display: none
}

.tagify:not(.tagify--mix) .tagify__input * {
    display: inline;
    white-space: nowrap
}

.tagify__input {
    display: block;
    min-width: 60px;
    margin: 2px;
    padding: .25rem .5rem .25rem .675rem;
    line-height: inherit;
    position: relative;
    white-space: pre-line
}

.tagify__input::before {
    display: inline-block;
    width: 0
}

.tagify__input:empty {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex
}

.tagify__input:empty::before {
    -webkit-transition: .2s ease-out;
    transition: .2s ease-out;
    opacity: .7;
    -webkit-transform: none;
            transform: none;
    width: auto
}

.tagify__input:focus {
    outline: 0
}

.tagify__input:focus::before {
    -webkit-transition: .2s ease-out;
    transition: .2s ease-out;
    opacity: 0;
    -webkit-transform: translatex(6px);
            transform: translatex(6px)
}

@supports (-moz-appearance: none) {
    .tagify__input:focus::before {
        display:none
    }
}

.tagify__input:focus:empty::before {
    -webkit-transition: .2s ease-out;
    transition: .2s ease-out;
    opacity: .5;
    -webkit-transform: none;
            transform: none
}

@supports (-moz-appearance: none) {
    .tagify__input:focus:empty::before {
        display:inline-block
    }
}

.tagify__input::before {
    content: attr(data-placeholder);
    line-height: 1.8;
    position: absolute;
    top: 0;
    z-index: 1;
    color: #526484;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0
}

.tagify--mix .tagify__input::before {
    position: static;
    line-height: inherit
}

@supports (-moz-appearance: none) {
    .tagify__input::before {
        line-height:inherit;
        position: relative
    }
}

.tagify__input::after {
    content: attr(data-suggest);
    display: inline-block;
    white-space: pre;
    color: #526484;
    opacity: .3;
    pointer-events: none;
    max-width: 100px
}

.tagify__input .tagify__tag {
    margin: 0
}

.tagify__input .tagify__tag>div {
    padding-top: 0;
    padding-bottom: 0
}

.tagify--mix {
    line-height: 1.7
}

.tagify--mix .tagify__input {
    padding: 5px;
    margin: 0;
    width: 100%;
    height: 100%;
    line-height: inherit
}

.tagify--mix .tagify__input::after {
    content: none
}

.tagify--select::after {
    content: ">";
    opacity: .5;
    position: absolute;
    top: 50%;
    right: 0;
    bottom: 0;
    font: 16px monospace;
    line-height: 8px;
    height: 8px;
    pointer-events: none;
    -webkit-transform: translate(-150%,-50%) scaleX(1.2) rotate(90deg);
            transform: translate(-150%,-50%) scaleX(1.2) rotate(90deg);
    -webkit-transition: .2s ease-in-out;
    transition: .2s ease-in-out
}

.tagify--select[aria-expanded=true]::after {
    -webkit-transform: translate(-150%,-50%) rotate(270deg) scaleY(1.2);
            transform: translate(-150%,-50%) rotate(270deg) scaleY(1.2)
}

.tagify--select .tagify__tag {
    position: absolute;
    top: 0;
    right: 1.8em;
    bottom: 0
}

.tagify--select .tagify__tag div {
    display: none
}

.tagify--select .tagify__input {
    width: 100%
}

.tagify--invalid {
    border-color: #728092
}

.tagify__dropdown {
    position: absolute;
    z-index: 9999;
    -webkit-transform: translateY(4px);
            transform: translateY(4px);
    overflow: hidden;
    -webkit-box-shadow: 0 1px 4px rgba(54,74,99,.1);
            box-shadow: 0 1px 4px rgba(54,74,99,.1);
    border-radius: 4px
}

.tagify__dropdown[placement=top] {
    margin-top: 0;
    -webkit-transform: translateY(-4px);
            transform: translateY(-4px);
    -webkit-box-shadow: 0 -1px 4px rgba(54,74,99,.1);
            box-shadow: 0 -1px 4px rgba(54,74,99,.1)
}

.tagify__dropdown--text {
    -webkit-box-shadow: 0 0 0 3px rgba(101,118,255,.1);
            box-shadow: 0 0 0 3px rgba(101,118,255,.1);
    font-size: .9em
}

.tagify__dropdown--text .tagify__dropdown__wrapper {
    border-width: 1px
}

.tagify__dropdown__wrapper {
    max-height: 300px;
    overflow: hidden;
    background: #fff;
    border: 1px solid #e5e9f2;
    padding: .25rem;
    border-radius: 4px;
    -webkit-transition: .25s cubic-bezier(0,1,.5,1);
    transition: .25s cubic-bezier(0,1,.5,1)
}

.tagify__dropdown__wrapper:hover {
    overflow: auto
}

.tagify__dropdown--initial .tagify__dropdown__wrapper {
    max-height: 20px;
    -webkit-transform: translateY(-1em);
            transform: translateY(-1em)
}

.tagify__dropdown--initial[placement=top] .tagify__dropdown__wrapper {
    -webkit-transform: translateY(2em);
            transform: translateY(2em)
}

.tagify__dropdown__item {
    -webkit-box-sizing: inherit;
            box-sizing: inherit;
    padding: .25rem .5rem .25rem .675rem;
    margin: 1px;
    cursor: pointer;
    border-radius: 2px;
    position: relative;
    outline: 0
}

.tagify__dropdown__item--active {
    background: #6576ff;
    color: #fff
}

.tagify__dropdown__item:active {
    -webkit-filter: brightness(105%);
            filter: brightness(105%)
}

.tagify__dropdown__createTagBtn {
    width: 100%;
    background: #6576ff;
    color: #fff;
    border: none
}

.dark-mode .tagify__tag:hover:not([readonly]) div::before,.dark-mode .tagify__tag>div::before {
border-color: #1d2d40!important
}

.dark-mode .tagify__tag:hover:not([readonly]) div::before,.dark-mode .tagify__tag>div::before {
    -webkit-box-shadow: 0 0 0 1.1em #101924 inset;
            box-shadow: 0 0 0 1.1em #101924 inset
}

.dark-mode .tagify__tag>div {
color: #b6c6e3
}

Thanks man!

Your code didn't work for me ..... but it did point me in the right direction. This worked!

[data-bs-theme=dark] .tagify__dropdown__item {
    background: #196d87;
    color: #fff
}
3 Likes

Peehaps the core tagify css needs a be tweak in Wappler to be dark mode compliant @Teodor ?

1 Like

I will +1 this as a feature request. I'm currently implementing dark mode for Tagify and it's a tedious, manual process.