Changing the Header Colors

EmpowerID provides an overrides directory within the EmpowerID Web CDN that can be used to customize the theme of the Web site. This allows you to change the default look and feel of the site to match your corporate brand or that of a partner who uses the site. To do so, you place the appropriate CSS files, images and scripts within the specified folders of the overrides directory. EmpowerID then "picks up" your files from the overrides directory, replacing the application's default files with them. This topic demonstrates this by showing you how to change the color of the header used by the Web application.

The styles for the default theme of the EmpowerID Web application are defined by the classes in the design.css file, which is located at "\Program Files\TheDotNetFactory\EmpowerID\Web Sites\EmpowerID.Web.Cdn\Themes\EmpoweID."

Changing the color of the header involves overriding the CSS class that defines it. In EmpowerID, this class is the eid-main-header class. When changing the header, you override the properties of the class, replacing the default values with yours. For eid-main-header, these properties are as follows:

  • top - Specifies the top edge of the header in relation to the top edge of its containing element
  • background - Specifies the color of the header
  • border - Specifies the border of the header
  • z-index - Specifies the z-order or vertical stacking of the header
  • height - Specifies the height of the header

To override the header, you create an overrides.css file with a custom definition for the eid-main-header class and place that file within the overrides directory mentioned above. The path to the file is critical as EmpowerID will not incorporate your changes if the path is incorrect. In a default installation of EmpowerID, the path looks as follows:

\Program Files\TheDotNetFactory\EmpowerID\Web Sites\EmpowerID.Web.Cdn\Overrides\Themes\EmpowerID
This path should already exist; if it does not, you need to create it.

This topic demonstrates how to change the color of the header used in the EmpowerID Web application and is divided into the following activities:

To override the eid-main-header CSS class

  1. Using any text editor create a CSS file named overrides.css and place it in the EmpowerID folder that is located within the EmpowerID Web CDN Overrides directory. The path to the file should be as follows:
  2. \Program Files\TheDotNetFactory\EmpowerID\Web Sites\EmpowerID.Web.Cdn\Overrides\Themes\EmpowerID\overrides.css
    If overrides.css already exists, you just need to open and edit the file for the header as shown below.

  3. Add code to overrides.css to change the default color of the header with yours. This code needs to override the properties of the eid-main-header class. In the example, we are changing one property, the background property, specifying a different color and changing it to a radial gradient background. Since we are only changing this one property, we do not need to add the others to the custom class definition.
  4. When adding your code, be sure to name the class exactly as shown. If you do not, EmpowerID will ignore your changes.
        /*custom header color*/
             background: #466368;
             background: -webkit-radial-gradient(#648880, 293f50);
             background: -moz-radial-gradient(#648880, 293f50);
             background: radial-gradient(#648880, 293f50);
  5. Save your changes.

To test the CSS override

  1. Open your browser and navigate to the EmpowerID Web application in your environment.
  2. You should see that the default header has been updated to reflect the changes you made.

    You can revert back to the original header by removing the eid-main-header class from the overrides.css file.