XF 2.0 Replace Prefixes with Images

noise

Проверенные
Сообщения
78
Реакции
20
Баллы
710
могу сделать это ??

Я хочу изменить свой префикс на картинку
 
Последнее редактирование модератором:
noise, instead of text images?

Example

Код:
.label{
    border-radius: 0px;
    display: inline-block;
    position: relative;
    cursor: pointer;
    font-weight: bold;
    min-width: 65px;
    text-align: center;
    &:before{
        position: absolute;
        border-top-right-radius: 40px;
        border-right: 2px solid rgba(0,0,0,0.1);
        top: 0;
        bottom: 0;
        left: 0;
        padding: 1px 4px 0 3px;
        width: 20px;
        text-align: center;
    }
}

.addLabel(@name_nof, @color, @fa-uid:"none") when (iscolor(@color)){
    @name: e(%('label--%s', @name_nof));
    .@{name}{
        background-color: @color !important;
        border-color: shade(@color, 20%) !important;

        &when (lightness(@color) <  50%) {color: hardlight(@color, #cccccc) !important;}
        &when (lightness(@color) >= 50%) {color: hardlight(@color, #0a0a0a) !important;}

        &when (iskeyword(@fa-uid)){
            padding: 0 5px 0 32px;
            &:before {
                background-color: rgba(0,0,0,0.2)!important;
                content: "\@{fa-uid}";
                font-family: FontAwesome;
            }
        }
        &when (isurl(@fa-uid)){
            padding: 0 5px 0 32px;
            &:before {
                background-color: rgba(0,0,0,0.2)!important;
                content: " ";
                background: @fa-uid no-repeat;
                background-size: contain;
                background-position: center
            }
        }

        &:hover{
            background-color: darken(@color, 4%) !important;
        }
    }
}

Parameters of the addLabel function:


Less:

@name // The name of the new prefix.
// Possible Values: string, int, any

// Example: myPrefix, 5, "myPrefix", '5myPrefix'

// Note: If your name is a constant, you must specify the value ONLY in quotes:


@color // The background color of the prefix

// Possible values are: hex, rgb (a), hsl (a)

// Example: # 87ceeb (skyblue), rgb (135, 206, 235), hsl (197, 71%, 73%)


@ fa-uid // The prefix icon

// Possible values: Font Awesome Unicode (f0e3) or url ('path / to / img')

// Example: f0e3 or url ('path / to / img.png')
 
Последнее редактирование:
prefixiconpreview-png.43819

как это
 
Современный облачный хостинг провайдер | Aéza
Назад
Сверху Снизу