Customizing Hyperlink Colors in SharePoint Online Theme

Alise Croft 0 Reputation points
2025-02-03T04:14:37.81+00:00

Is there a method to change the hyperlink colors in a SharePoint Online theme?

Currently, using the Dark Grey Theme results in hyperlinks appearing grey. For improved accessibility and usability, a change to standard link blue for unvisited links and purple for visited links is desired. What steps can be taken to achieve this customization?

SharePoint
SharePoint
A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.
11,174 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Ling Zhou_MSFT 21,245 Reputation points Microsoft Vendor
    2025-02-03T08:04:02.8866667+00:00

    Hi @Alise Croft,

    Thanks for reaching out to us. We are very pleased to support you.

    Of course, we can use an online Theme Generator tool to customize the colors of the unvisited and visited links and apply custom themes through SharePoint Online Management PowerShell.

    Here are the steps you can follow:

    1. Open Fluent UI Theme Designer.
    2. Change themePrimary and themeDarkAlt value. Click on the color to modify it.

    User's image

    {
      "themePrimary": "#0078d4", // Unvisited link color (blue)
      "themeDarkAlt": "#5c2d91"  // Visited link color (purple)
    }
    
    1. Click the Export Theme button above and select PowerShell. Copy the code into the text for subsequent use.

    User's image

    User's image

    1. Download and install the SharePoint Online Management Shell. If you already have a previous version of the shell installed, uninstall it first and then install the latest version. Ignore this step if it is already the latest version.
    2. Please connect your tenant admin to run the following command to connect to Your Tenant:
         Connect-SPOService -Url https://<your-tenant>-admin.sharepoint.com
      
    3. Continue executing the following code to create and apply the theme to your target site.
         # Define the theme palette
         $themePalette = <The PowerShell code you copied earlier>
         
         # Add the custom theme, please customize your theme name
         Add-SPOTheme -Identity "yourCustomTheme" -Palette $themePalette -IsInverted $false
         
         # Apply the theme to a site
         Set-SPOWebTheme -Theme "yourCustomTheme" -Web https://<your-tenant>.sharepoint.com/sites/<your-site>
      

    For more information on customizing your theme see: SharePoint site theming.

    If you have any questions, please do not hesitate to contact me.

    Moreover, if the issue can be fixed successfully, please click "Accept Answer" so that we can better archive the case and the other community members who are suffering the same issue can benefit from it.

    Your kind contribution is much appreciated.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.