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?
 
Why are we even doing this? 2.3 ships with 7870 Font Awesome SVGs.
\xenforo_2.3.0-Beta-6-Unstable_28DaysLater_2388B35DCE_upgrade\upload\styles\fa\regular alone has 1853 SVG files.

I simply want to be able to select one of these per node.

Any update on this now that 2.3 is finally here? Can we change the node icons without faffing about in CSS?
 
Any update on this now that 2.3 is finally here? Can we change the node icons without faffing about in CSS?

It's not there and the suggestion is 14 years old this month.

 
That adds an icon, but the original SVG is still there....

View attachment 301744


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)?

.node--idxx .node-icon i
{
&:before
{
.m-faContent(@fa-var-loading);
}
svg
{
display: none;
}
}

That work well for me, i keep the standard icons and get my custom's one without duplicating.
 
Why are we even doing this? 2.3 ships with 7870 Font Awesome SVGs.
\xenforo_2.3.0-Beta-6-Unstable_28DaysLater_2388B35DCE_upgrade\upload\styles\fa\regular alone has 1853 SVG files.

I simply want to be able to select one of these per node.
I agree. Utilizing display: none feels like an inelegant workaround for incorporating the desired Font Awesome (FA) icons. It’s akin to regressing rather than progressing, especially when we should be striving for greater convenience, especially with icons.
 
Back
Top Bottom