Skip to content

Customizing the My Account UI

From WSO2 Identity Server 5.10.0 onwards, a new My Account has been introduced which is the successor to the dashboard. It also adheres to the UI extensions scheme introduced with WSO2 Identity Server 5.9.0 to use a centralized theming for all the front-end portals.

Note

The My Account application has been renamed as My Account from this release onwards.

This section explains how we can customize the theming of My Account.

Changing the default theme to dark mode

Info

A customized version of the default theme in the Semantic UI LESS package has been used to achieve the look and feel of the My Account.

default-my-account-theme

For information on the Semantic UI theming, see Semantic UI documentation.

Before you begin

  1. Check out the corresponding identity apps source code from the repo and set it up in the development environment. Check out the latest tag of the identity-apps. The v1.0.72 tag is used in the sample mentioned below.
$ git fetch --all --tags --prune
$ git checkout tags/v1.0.72 -b feature-dark-theme-demo
  1. Navigate to the modules/theme/src/themes folder within identity-apps. All the theme global variable overrides can be found in the modules/theme/src/themes/default/globals/site.variables file. For the full set of variables, see the original theme variables file.

Follow the steps given below to further customize My Account.

Step 1: Change the primary color of the portal

In order to change the primary color of the portal, the variables in site.variables need to be overridden.

  1. Add a new color under the site colors and name it. In this example it is named, facebookBlue.

    /*-------------------
        Site Colors
    --------------------*/
    
    @facebookBlue     : #2d88ff;
  2. Now change the primary color variable.

    /*-------------------
        Brand Colors
    --------------------*/
    
    @primaryColor        : @facebookBlue;
  3. Next, change the page background color and text color. In this example, the background color is changed from white to dark gray and the default text color is changed to a lighter shade. Add a new variable under the brand colors. It is called globalBackgroundColor in this example.

    /*-------------------
        Brand Colors
    --------------------*/
    
    @globalBackgroundColor: #18191a;
  4. Override the @pageBackground variable.

    /*-------------------
            Page
    --------------------*/
    
    @pageBackground      : @globalBackgroundColor;
    @textColor           : #e4e6eb;
  5. Build the theme module by running the following command and check the results reflected on the dev server.

    # from inside `modules/theme`
    $ npm run build
    The response should be similar to the screenshot given below.

    custom-theme-1

    As seen in the image above, the background color of the header, footer, side navigation, and content cards can be changed.

  6. In order to change the header and footer background colors, add a new variable to the modules/theme/src/themes/default/collections/menu.variables file under the brand, "colors". This variable is named globalForegroundColor in this example.

    @background: @globalForegroundColor;
  7. Change the side panel background in the modules/theme/src/themes/default/collections/menu.overrides file.

    .ui.vertical.menu {
        &.side-panel {
            background: @globalBackgroundColor;
    
            // Other styles
        }
    }
  8. Modify the content card background color in the modules/theme/src/themes/default/views/card.variables file.

    @background: @globalForegroundColor;
    The status can be checked by rebuilding the theme module. The changes should be reflected on the running dev server in no time. A sample screen of the new theme is shown below. custom-theme-2

Step 2: Change the branding

Now that the styling is complete, the following steps explain how the product branding can be changed.

  1. Change the product logo.

Use one of the following methods to change the product logo.

Method 1 (Recommended)

If the logo should be changed without touching the compiled javascript bundle, follow these instructions to override the existing WSO2 IS logo using CSS.

  1. Download an icon from any of the providers such as Flaticon.com. In this example, owl.svg was the downloaded icon. Now add it to the modules/theme/src/themes/default/assets/images folder.

  2. Open the modules/theme/src/definitions/globals/product.less file and replace the existing styles in the .product-logo class with the following.

    .product-title {
        .product-logo {
            width: 25px;
            height: 25px;
            vertical-align: text-top;
            margin-right: 5px;
            background: url(assets/images/owl.svg) no-repeat;
            background-size: auto;
    
            svg {
                display: none;
            }
        }
    
        // Other styles
    }

Method 2

  1. Download an icon from any of the providers such as Flaticon.com. In this example, owl.svg was the downloaded icon. Now add it to the modules/theme/src/themes/default/assets/images folder.

  2. Open the modules/theme/src/index.js file and replace Logo with the path to the new icon.

    export const Logo = require("../lib/assets/images/owl.svg");
    3. Build my-account artifacts.

    npx lerna run build — scope @wso2is/my-account
  3. Copy the main.js and main.js.map files from the apps/my-account/build/my-account folder and paste it inside the my-account web app found in the <IS_HOME>/repository/deployment/server/webapps/my-account folder.

  4. Change the product title & copyright.

    Add the following entries to the runConfig window object in the <IS_HOME>/repository/deployment/server/webapps/my-account/index.jsp file.

    window["runConfig"] = {
        ...
        applicationName: "NIGHT OWL EXPRESS",
        copyrightText: "Night Owl Express © 2020"
    };
    6. Change the Favicon.

    Replace favicon.ico in the <IS_HOME>/repository/deployment/server/webapps/my-account folder with the desired icon.

    Tip

    If you do not have a favicon already, you can use an online generator like favicon.oi to generate a favicon for free.

  5. Change the title.

    Change the <title> tag in the <IS_HOME>/repository/deployment/server/webapps/my-account/index.jsp file.

    <title>Night Owl Express</title>

Step 3: Deploy the changes in the web app

The final step of the process is the deployment. Follow the sequence of steps listed below to deploy the changes performed in the previous steps.

  1. Build the theme module.

    # from inside modules/theme
    $npm run build
  2. Copy the artifacts to the web app.

    The built artifacts will be available inside the modules/theme/lib folder. Copy everything to the clipboard and navigate to my-account web app in the WSO2 IS pack.

    Copy everything to the clipboard and paste it inside the <IS_HOME>/repository/deployment/server/webapps/my-account/libs/styles/css folder.

    Warning

    Make sure that you keep a backup of the original CSS folder.

The final theme should look similar to following.

final-theme1 final-theme2 final-theme3 final-theme4

Top