Styling Blocks

Blocks can be easily styled using a theme. Together with our imagery and character recommendations, a theme helps you create a personalized user experience. Our base theme is built with CSS variables, which you can modify to align with your brand guidelines. Variables ensure reusability, consistency, and simplified maintenance within the theme.

Nitro supports updating the variables in the base stylesheet to align with brand standards. However, making additional changes beyond the standard variables could affect ADA compliance and cause issues as new features are released. Any customizations outside the standard stylesheet variables are done at your own risk and will not be supported.

Create a Theme

When you activate a theme in the theme builder, all embedded blocks will automatically update their styles to match that theme. If you do not have an active theme, blocks will use the default out-of-the-box styles.

  1. Open Nitro Studio > Integrate > Themes.

  2. Click New, or click an existing theme to edit.

  3. Click Edit (Edit Icon) and enter a theme name.

  4. Upload or link to your custom CSS file. If a stylesheet is stored in an external location, Nitro must have access to that location. Show me the supported characters for a CSS file nameClosed

  1. Use the Activate Theme toggle to set the theme as the active theme for all blocks.

Only one theme can be set as the active theme. If you delete or deactivate the active theme, all blocks will revert to the default styles.

  1. Use the Preview list to view the theme in an Impact or Recognitions block.

  2. Click Save.

Note: If you're testing a theme by uploading the same stylesheet multiple times and your changes aren't reflected in the theme preview, try changing the name of the CSS file and uploading again.

Stylesheet Best Practices

Common Style Overrides

To override a variable, find the property you want to update and change the value to your custom setting. All variable overrides must be inside the root. Show me an exampleClosed

Stylesheet Example

The following are elements you may want to change to support your brand. Some colors are derived from the variable color.

Additional overrides are available if you need to create a more robust custom theme. Your account team can provide the full stylesheet.

Block

Element to Change

Property

Nitro Impact

The color of the call-to-action buttons in mission tiles (Get Started, Continue, View, etc.) and the circles highlighting positions 1-3 in leaderboard.

--bb-color-brand-primary:

The color of the award account balance background and secondary button’s background.

--bb-color-brand-secondary:

The background color of Impact. By default, this is light gray.

--bb-color-brand-background:

The color of the award account balance background.

--bb-award-account-balance-bg-color:

The color of the progress bar in the At a Glance section.

--bb-at-a-glance-point-graph-earned:

The font.

--bb-font-family:

The outer padding between the block's edges and the elements within it.

--bb-impact-padding

Recognitions

 

 

 

 

The color of the "Send a recognition" button.

--bb-color-active-light:

The color of the active tab, active tab text, and "Send a recognition" button border.

--bb-color-active:

The color of the inactive tab and text hover.

--bb-color-active-hover:

The color of the reward pill.

--bb-color-reward-light:

The color of the secondary reward pill.

--bb-color-xlight:

Custom Fonts

When styling blocks, Nitro supports default fonts, Adobe and Google fonts, and custom fonts that are externally hosted in a location Nitro can access. Code is added to the theme's stylesheet to render the selected font.

Show me how to use a default fontClosed

Default fonts, such as Arial or Times New Roman, are widely supported and installed on all computers. These steps use Times New Roman as an example.

  1. Get the information for the font you want to use.

  2. Add the font to the stylesheet within the root using the --bb-font-family variable.

    Variable

    Value

    --bb-font-family:

    "Times New Roman", serif;

Show me how to use a Google fontClosed

These steps use Poppins as an example.

  1. Get the @import embed code for the font you want to use.

  1. Add the embed code to the top of the stylesheet before the root. Only add the @import information. Do not add the <style> tags.

  1. Add the font to the stylesheet within the root using the --bb-font-family variable.

    Variable

    Value

    --bb-font-family:

    "Poppins", serif;

Show me how to use an Adobe fontClosed

These steps use Komet as an example.

  1. Get the @import embed code for the font you want to use.

  1. Add the embed code to the top of the stylesheet before the root. Only add the @import information. Do not add the <style> tags.

  1. Add the font to the stylesheet within the root using the --bb-font-family variable.

    Variable

    Value

    --bb-font-family:

    "komet", sans-serif;

Show me how to use a custom fontClosed

The following are general configuration steps to use a proprietary/custom font. Setup may differ depending on server settings, privacy policies, and so on.

  1. Upload your custom font to an htdocs folder on your server.

  2. Configure the server's CORS policy (Cross-Origin Resource Sharing) through the .htaccess file to allow Nitro access to the font. Show meClosed

  1. Add @font-face to the top of the stylesheet before the root. Each font or font style/weight must be referenced individually. Show me an exampleClosed

  1. Add the font to the stylesheet within the root using the --bb-font-family variable. Show meClosed

  2. If the font is not displaying as expected, verify the following:

    • Confirm the https path is correct. If you enter the URL of the font into a browser, you should be able to download the font.

    • Check the console log for errors. If the CORS policy is not properly configured, you will see an error. You can also test a CORS policy using tools such as Codepen.

    • Confirm that the name you chose for the font matches the name you used in the --bb-font-family variable.

    • Confirm there are no spaces or special characters in the font-family name.

Example Themes

The following examples change the font, the buttons in Impact and recognitions from blue to red, and the mission tile gradient to grays.

Show me an example using a Google fontClosed

Show me an example using a custom font with one weightClosed

Show me an example using a custom font with multiple weightsClosed

See also

Embed a block

Blocks