Styling your Harmoni dashboards to make them more visually appealing helps users engage with the content and easily find the information they need. When creating dashboards, there are several options available to format your containers, but if you require a more complex design, an HTML editor is available for those experienced with HTML CSS code.
To style your dashboards, you can use Inline CSS for specific elements, In-container CSS for the entire page, or Custom CSS files to ensure a consistent style across all dashboard pages.
In this article
1. Styling your Dashboard with CSS
The text container includes an HTML editor that offers great design flexibility with a combination of HTML and CSS (Cascading Style Sheets). With CSS styling, you can customize the look of your dashboard to control aspects like colors, fonts, layout, and responsiveness. You can learn more about CSS here.
There are several ways to customize your Harmoni dashboard CSS:
- Add inline CSS to specific HTML elements.
- Use the <style> tag in the head to define CSS rules for multiple containers.
- Create a separate Custom CSS file to affect all dashboard pages.
If you wish to use a custom CSS file for your site, contact support@infotools.com
Inline Styles (Individual Elements)
To style a single HTML element, you can use the style attribute for inline CSS. This approach allows you to override other styles from in-container CSS or a Custom CSS file when needed.
Add inline styles:
- Insert the style attribute in the desired HTML element.
- Within double quotes, include CSS property-value pairs separated by semicolons.
For example:
We can change the font size, spacing, and color.
<div style="font-size: 4vw; line-height:1;"> |
- Open the HTML editor in your text container
- Add style attribute to the element
- Insert all inline CSS
- Save
Container Styling (Multiple Containers)
A style can be defined in one container, and used in another. You can create classes or IDs and include a CSS <styles> block at the start of your HTML code. This approach supports complex CSS and external resources like Google Fonts or background images.
Add an HTML<style> tag
- Add unique class names or ID names to the HTML elements you want to style.
- Add the <style> block in at the top of your HTML code.
- Use CSS selectors to target elements and place the rules inside the <style> tags.
For example:
|
<style>
|
- Click Edit Html to open the editor
- Define a class attribute for the HTML element
- Create a <style> tag and add the CSS rules
- Save
Page-Level Styling
When you use the same Id or class name in different containers, all HTML elements with that name will share the same styles, regardless of their location. This can be quite useful if you want to apply the same styles to several containers on the same page.
For example, in one container with the following style:
|
<style> .Marketlink { </style> <div class="Marketlink">Awareness</div> |
To apply the same style in another container, use the class or ID name:
| <div class="Marketlink">Sales</div> |
- Create a style tag in one of the containers
- Use the same class name to all text containers
- Items sharing a class name have same CSS styles
Custom CSS File (Site-wide Styling)
To maintain a consistent look for your site, including elements like font, color, and a specific template that aligns with your corporate identity for your dashboard, you can create a Custom.css file.
The Custom.css is an external style sheet that applies CSS styling globally to your entire site, and can be used by all the different dashboard pages.
Add styles across multiple dashboards:
- Create a file named custom.css
- Add your CSS rules within this file
- Contact Harmoni Support to upload your custom.css
This is also a great time to upload any additional dashboard assets, e.g., images, logos, etc. - After uploading, style your HTML elements by adding the right class names or IDs in the HTML editor in each text container
Each site can have one custom.css file. Use unique class names to prevent style conflicts. Please contact support@infotools.com. to upload the file.
- Once the Custom.css is loaded, use the HTML editor to apply styles
- Add the defined class name from the CSS style sheet
- All containers with the same class share the CSS style
2. CSS Rules and Customization
CSS Priority Rules in Harmoni
When multiple styles are specified for the same HTML element, they "cascade" according to these priority rules, with the first having the highest priority:
- In-line styles (highest priority)
- In-file/In-container styles
- Custom CSS file
- Default Harmoni CSS (lowest priority)
Styling Links
Harmoni automatically assigns the container to a default class name .e-richtexteditor .e-rte-content .e-content. If you want to customize link styles, select both the default class and your custom class, along with the a tag in your CSS.
For example:
|
<style> <div class="btn-effect"> |
If your custom links include special characters, you might want to look into HTML URL encoding.
For example, if the axis name is Travel Style (Grouped), you can create a global filter link using the code below:
<a href="#/dashboard/34/gfilter:Travel Style%28Grouped%29.Tour">Tour Group</a> |
Styling Images
Harmoni automatically assigns images to a default class name e-rte-image e-imginline. To apply custom styles, define a new class and reference it in your image tag's class attribute.
For example:
|
<style> .home-btn .hide { display: none; } </style> <div class="home-btn"> <img src="your_image_url" class="e-rte-image e-imginline hide"> </div> |
3. Managing Assets and Fonts
Assets
While you can use the Image or Embed containers to personalize your dashboard and add information, you need to use the HTML editor in the text container to add some extra styling.
Images and documents need to be uploaded to Harmoni's hosting platform first. Please get in touch with support@infotools.com for more information.
- Supported image formats include .jpg, .png, .svg, and .gif
- Animated GIF (when exported to PowerPoint, only the first frame displays)
Fonts
Harmoni supports system fonts by default. These include Arial, Courier New, Georgia, Impact, Lucida Console, Tahoma, Times New Roman, Trebuchet MS, and Verdana.
To use custom fonts, add your font files (.woff and .woff2) to assets or link fonts from sources like Google Fonts. Edit the Custom.css file or use the <style> tag in the Text Container.
Here is an example of how to create inline CSS with web fonts using Text Containter, which works similarly to adding them to the Custom.css file:
|
<style> @import url('https://fonts.googleapis.com/css?family=Leckerli+One&display=swap'); .title{ font-family: 'Leckerli One', cursive; </style> <div class="title"> |
Where to from here?
Learn more about Harmoni: