Updating Twitter icon to X logo

AI-generated summary

The Discourse team has temporarily added the X logo as an available icon to allow communities to update their Twitter branding. JammyDodger provides steps to implement the change, including adding the icon to the SVG icon subset and creating a theme component with specific code. darkpixlz questions whether the upgrade to Font Awesome will be optional, expressing a preference for keeping the Twitter bird logo. tknospdr encounters issues implementing the change and seeks clarification. Moin confirms that the X icon is included in Font Awesome 6 and provides guidance on using the correct icon prefix. The discussion also touches on the potential confusion between HTML examples and Font Awesome branding icons.

professor farnsworth futurama GIF

We’ve temporarily added the X logo as an available icon in core Discourse to allow everyone to make the branding switch on their own. Upgrading the entirety of Font Awesome in Discourse is a very large project, so this is meant to allow a workaround in the mean time.

If you’re looking to make the change, you can follow these steps:

  1. Add temporary-twitter-x to your svg icon subset site setting

  2. Create a new theme component and add the following code to the noted sections:

    Common > Head

    <script type="text/discourse-plugin" version="0.11">
      api.replaceIcon('fab-twitter', 'temporary-twitter-x');
    </script>
    

    Common > Color Definitions

    :root {
     --twitter: $twitter-or-white: dark-light-choose(unquote("#000"), unquote("#fff"));
    }
    

And that should be that. :slight_smile: :+1:

You may also wish to update your site text customisations to use the new branding if you haven’t already:

/admin/customize/site_texts?q=twitter

Hopefully this will suffice until a more permanent solution is in place :crossed_fingers: (or it gets changed to something entirely different next month :slight_smile:)

When this eventually happens, will it be optional? I don’t care what Elon says, I’m calling it Twitter, it is not “x”, and I’m keeping it that way on my sites. The logo looks bad anyways, I want to keep the bird.

Even if it was the default behavior, you could still use the same code in reverse to replace the 𝕏 with the :bird:.

I’m not a developer, so I don’t know how to do this, but when using these instructions I get an admin warning banner that points to this page…

Can this be updated so I don’t lose the X icon?

You don’t need that anymore as the X icon is included in FontAwesome 6 and Discourse was updated to use that.

That’s good to know, but when I tried with the ‘x-twitter’ icon, it gave me an empty blank space. When I added ‘fa-x-twitter’ to the list of SVG icons, there was no change.

What should I be doing to make it show up officially?

Brand icons need fab (font awesome brand) as a prefix

I just saw that from your other post, thanks.

Based on what I saw on the FA website I thought it was just supposed to be fa-x-twitter

Maybe you were confused by the html example


But you can for example see the fab here

Probably. I just point and click like a madman sometimes.