XF 2.3 Replacing node icons via css

JoyFreak

Well-known member
In 2.2 you could simply do this with a css hack:
Code:
.node.node--id(node_id) .node-icon i:before {
    content: "\f019";
}

But now I see 2.3 uses svg. How does one replace the node icon using css with svg's?
 
You should use the mixin/LESS variables (in XF 2.2 too):

Less:
.node.node--id(node_id) .node-icon i
{
    &::before
    {
        .m-faContent(@fa-var-download, 1em);
    }

    svg
    {
        display: none;
    }
}
 
Last edited:
You should use the mixin/LESS variables (in XF 2.2 too):

Less:
.node.node--id(node_id) .node-icon i:before {
    .m-faContent(@fa-var-download);
}

This does indeed load a second icon. This CSS only approach seems to work:

Code:
.node .node-icon i
{
    &:before 
    {
        .m-faContent(@fa-var-upload);
        width: 100%;
    }
    svg
    {
        display: none;
    }
}

But it's essentially hiding the default SVG icon. Would you recommend a better approach (CSS only)?
 
You should use the mixin/LESS variables (in XF 2.2 too):

Less:
.node.node--id(node_id) .node-icon i:before {
    .m-faContent(@fa-var-download);
}
This worked for me. Why aren’t you using this instead?

Edit: from your post above it seems you are using that. I don’t know what I did. I think I must have hidden the svg as russ suggested above. I can’t really check right now as on mobile. Can confirm later.
 
This worked for me. Why aren’t you using this instead?

Edit: from your post above it seems you are using that. I don’t know what I did. I think I must have hidden the svg as russ suggested above. I can’t really check right now as on mobile. Can confirm later.

2.3 Beta 5 that code on a completely stock default style:

1713984402114.webp

No add-ons installed.
 
This is working for me on XF 2.3 Beta 5:

l
Less:
.node.node--idX {
    &.node--forum {

        .node-icon i {
            .m-faContent(@fa-var-dot-circle);
        }
        &.node--read .node-icon i {
            opacity: 0.4;
        }
    }
}


I don't see how this works on 2.3. I think you'll need to update the resource with hiding the SVG icon as well @BassMan
 
Top Bottom