A theme consists of UI elements such as logos, images, landing page text, background colors etc. WSO2 API Store comes with a default theme called
Fancy. The easiest way to change the user interface of the API Store is by customizing the default theme.
All themes have a folder structure similar to the following:
Since the default theme already has most of the UIs and JSON logic defined, in a typical scenario, you would not implement the theme from scratch. You can customize the default theme by bundling together the changes (e.g., CSS code, images) as a .zip file, and uploading it through the Admin Dashboard Web application. Once uploaded, the files in the .zip override the corresponding files in the default theme. The rest is inherited from the default theme.
- To override the default theme, ensure that you upload UI changes, fonts, and images as follows:
- UI changes as CSS code
- Fonts in SVG, TTF, EOT, WOFF, WOFF2 or OTF formats
- Images in JPG, PNG, or GIF formats.
Let's get started.
You can either take a look at the following video tutorial or go through the step-by-step instructions given below.
Here's a step-by-step walk-though of the video tutorial:
Before you begin, download the default theme from fancy.zip, unzip it and rename the folder to the name of your new theme (e.g., ancient). Let's call this folder
<THEME_HOME> throughout this section. Then, follow the steps below depending on the changes you want to apply to the theme:
- To change the logo of the API Store, replace
<THEME_HOME>/libs/theme-wso2_1.0/images/logo-inverse.svgwith a preferred logo.
- To change the logo of the API Store's self sign up page, replace the
<THEME_HOME>/images/logo-white.pngwith a preferred logo.
- If you want to make any of the changes given below, open the
<THEME_HOME>/css/custom.cssfile using a text editor and add the appropriate CSS code blocks to the end of the file depending on the changes you want to apply:
Add the following to change the color of the header:
Add the following to change the color of the top navigation bar:
Add the following to change the color of the search box and its fonts:
To change the color of the drop-down list of API categories to search:
To change the color of the search button:
To change the font of the menus, headings, and labels to Verdana:
You can specify several fonts to ensure maximum compatibility in case one font fails in a given browser/OS. If the first font you have listed fails, the next font that you've listed will be applied.
To change the background color:
To change the color of the buttons:
When changing the color of buttons, changing only the background color will not have a visual impact if you leave the gradients as they are.
Once you are done with all the required customizations, you are ready to upload your theme changes as a sub-theme of the default main theme.
Before you upload your theme customizations, you need to delete all the files except the ones that you just edited in your
<THEME_HOME>folder. The rest of the files will be automatically applied from the main theme.
Follow the steps below to upload your theme customizations:
Go to the
<THEME_HOME>folder, select all the files/folders inside it, then (Ctrl+A) and right click to archive all the selected files and folders together.
Tip: Be sure to select all the files/folders (Ctrl+A) and right click on all the selected artifacts to create the archive file.
- Rename the archive file to
- Sign in to WSO2 API Cloud. This takes you to the API Publisher Web application.
- Click Admin Dashboard under the Configure menu. This opens the Admin Dashboard.
- Click SETTINGS and then click UPLOAD TENANT THEME.
- Upload your zip file (e.g., ancient.zip).
Open the API Store to take a look at the customizations that are applied.
Tip: It can take up to 15 minutes for a new theme to be applied to the API Store.
Similarly, open the sign up page to take a look at the customizations applied there.
In this tutorial, you applied a few selected UI changes to the API Store.