Portal Theming Guide¶
The look and feel of Portal interface can be customized according to certain themes. The Portal Interface is available presently in two themes:
- Default - default
- Kenya - ke
A subset of the CSS styles have been extracted into CSS variables. The variables are defined in vars.css files. A vars.css file is available for each theme and contains the styles specific to that theme. vars.css and the images used in a theme are present in the src/css/themes/<theme> folder. In order to apply a theme, edit the file .env. Change the value of the REACT_APP_THEME variable to the code of the required theme. For eg., to select the Default theme, the .env file should read:
REACT_APP_THEME=default
The env.development file overrides the .env file in development mode. In order to change the theme during development, modifying env.development alone will do.
The background, foreground colors for the text content in the top bar, section and footer areas , buttons and other UI controls, logos etc., are customizable.
Default theme¶
Kenya theme¶
Customizable CSS properties¶
Variable | Affected DOM | Images |
---|---|---|
--overrides-h-color | Font color of headings other than the branding area | |
--font-1 | General font-family excluding headings | |
--font-2 | Font family of headings including the branding area | |
--font-3 | Font family in the auto-suggest area | |
--font-small-heading, --react-tabs-tab-font | Font family in the sidebar field headings, tabs respectively. | |
--main-col-position | Position of the main content column - left or right | |
--content-grey-rule-bg-color | Horizontal divider line color | |
--content-text-block-color, --content-a-hover-color | Links color and hover color | |
--content-button-bg-color, --content-button-color | Button colors in the main content column | |
--content-tab-pane-bg-color | Background color of the tab pane | |
--content-search-result-bg-color, --content-search-result-box-shadow, --content-search-result-color, --content-search-result-h1-color | Styles the main content column(Figure shows the region in yellow) in the search pages. | |
--home-wbutton-bg-color | Background color of the buttons in the header and content area | |
--footer-bg-color, --footer-color | Text and background color for region marked in red in the figure. | |
--footer-a-color | Text color of links(marked in red in the figure) in the footer. | |
--footer-submit-bg, --footer-submit-color | Colors of the form button in the footer. | |
--footer-social-bg-color, --footer-social-color, --social-img-bg | Background, text color in the social media region of footer. | |
--pagecontentcolumn-color | Text color in the CMS pages. | |
--paginator-li-bg-color: Page item background --paginator-li-border-color: page item border color --paginator-li-color: Page item text color | ||
--reacttabs-bg-color: Tab background --reacttabs-color: Tab text color --reacttabs-selected-bg-color: Selected tab background color --reacttabs-selected-color: Selected tab text color --reacttabs-border: Tab border --reacttabs-border-radius: Tab border radius --reacttabs-bg-image: Tab background image (separator) --reacttabs-hover-bg-color: Hovered tab background color --reacttabs-hover-color: Hovered tab text color --reacttabs-selected-border: Selected tab border --reacttab-panel-border: React tab panel border |
||
--section-bg-color, --section-color | Background and text color of the main content and sidebar container; Version text background color(shown in yellow in the figure); Background and text color of document page download links | |
--section-flex-dir | Determines the order of the main content and sidebar in the layout. "row" and "row-reverse" values can be used to alter the position of the main columns. | |
--sidebar-col-position | Position of the sidebar column. Assign values 'left' or 'right' based on the position of the main content column. | |
--sidebar-bg-color - Background color of the sidebar (region in yellow in the figure) --sidebar-box-shadow - Shadow of the sidebar. --sidebar-border-radius - Border radius of the sidebar. |
||
--sidebar-a-color | Links text color in the sidebar region | |
--sidebar-small-heading-color - Text color of the filter headings(shown in yellow in the figure) --sidebar-small-heading-bg - Background color of the filter headings |
||
--topbar-bg - Background color of the top bar (shown in yellow in the figure) --topbar-box-shadow - Shadow of the top bar. | ||
--topbar-submit-button-bg-color | Background color of the site search submit button in the top bar | |
--logo-img-top - Brand logo in the top bar --logo-img-height, --logo-img-width - Dimensions of the logo image on the topbar --logo-color - Text color of the first line of heading in the branding area --navbrand-top-margin - Top margin of the nav-brand. Can align with top line of language switcher or search bar. | ||
--heading-above-search --second-header-row-display |
There are two types of layouts:
| |
--logotype-h1-bg --logotype-h1-height --logo-h1-font-size --logotype-h1-lineht --logotype-h1-font |
Styles of the first heading h1 | |
--logo-h2-font-size --logo-h2-mleft |
Styles of the second heading h1 - font size, left margin | |
--logo-img-float-994 --navbrand-mtop-994 --navbrand-display-994 |
Below 994px screen width, the header row is rearranged. The logo, and the headings are centered above the search box. | |
--sidebar-left-margin-767 --sidebar-right-margin-767 --navbrand-float-767 |
Below 767px screen width, the sidebar is hidden by default. It can be brought up using the burger menu button. The layout can either have the sidebar at the left or right. So clicking on the burger menu button, should bring it up from the right or left side and hide it by sliding it onto the same side. This property is used to set the side from which the sidebar swipes in and out. | |
--languageswitcher-bg-color - Background color of the language switch upon hover(red) --languageswitcher-highlight-bg-color - Background color of the current language(yellow). --lang-switch-font-size -Font size of text in language switcher | ||
--sidebar-left-margin, --sidebar-right-margin | The sidebar is collpsed by default on smaller screens and revealed using the burger menu button. Based on the position of the sidebar in the large screen, set left or right margin to 0px. The sidebar is attached to the side with zero margin. To which side the sidebar gets attached determines the swipe direction to close the sidebar. |