How can we help you today?

How to Add a Hover Color to the ShortPoint Tiles Design Element with Custom CSS

By default, the ShortPoint Tiles Design Element doesn't have the option to set a hover color for the tiles:


without hover color


However, with custom CSS, you can customize the hover color of tiles. Follow along to learn how.


with hover color


TABLE OF CONTENTS


Prerequisites

  • You must have the latest version of ShortPoint SPFx installed on your SharePoint environment.
  • You must be a ShortPoint Designer with an active license.
  • You must already have the Tiles Design Element on your page.
  • Your Tiles Design Element must not be dynamically connected. Otherwise, the hover color will not take effect.

Step-by-step Tutorial

There are two ways to add hover color to the Tiles Design Element. Follow the option that best suits your needs.

Option 1: Add a Single Hover Color

This option allows you to add only one hover color for all the items on your Tiles Design Element. Copy the code below before getting started:


.shortpoint-tile:hover .shortpoint-tile-bg-color {     background-color: cyan !important;     transition: 500ms;}



Step 1: Edit the ShortPoint Web Part

  • Go to the SharePoint page you want to use and click Edit:

Edit


  • Click the close icon to remove the Toolbox:

close icon


  • Click the ShortPoint tag.
  • Select the Edit Properties icon:

Edit properties icon


Step 2: Copy the Code

  • Copy the Custom CSS code below:


.shortpoint-tile:hover .shortpoint-tile-bg-color {     background-color: cyan !important;     transition: 500ms;}

Step 3: Edit the Tiles Design Element

NOTEBefore proceeding, make sure you already have the Tiles Design Element on your page. To learn how to add it, check out How to Customize the Tiles Design Element.

Tiles design element


  • Click the Tiles tag:

Tiles tag


  • Select the cogwheel icon:

cogwheel icon


Step 4: Paste the code

  • Click the next icon:


next icon

  • Navigate to the Custom CSS tab.
  • Paste the code.
  • Customize the background-color value according to your preferences.


NOTEThe hover color will not be displayed on Tiles with dynamically connected content.

Step 5: Save

  • Once satisfied with your changes, click the green check mark.
  • Click the eye icon to see your page in real-time:

eye icon

  • Click Save to apply all your changes:

Save


Option 2: Add Multiple Hover Colors

This option allows you to add different hover colors for each item on your Tiles Design Element. Copy the code below before getting started:


.shortpoint-tile:nth-child(1):hover .shortpoint-tile-bg-color {     background-color: cyan !important;     transition: 500ms;}.shortpoint-tile:nth-child(2):hover .shortpoint-tile-bg-color {     background-color: red !important;     transition: 500ms;}.shortpoint-tile:nth-child(3):hover .shortpoint-tile-bg-color {     background-color: yellow!important;     transition: 500ms;}



NOTES
[1] If you have more than three items on your Tiles, simply add this line again:

.shortpoint-tile:nth-child(n):hover .shortpoint-tile-bg-color {     background-color: yellow!important;     transition: 500ms;}

Then, change n to the number that corresponds to the new item. For example, if we were to add a fourth item, the line of code would be as follows:

.shortpoint-tile:nth-child(4):hover .shortpoint-tile-bg-color {     background-color: yellow!important;     transition: 500ms;}

[2] If your Tiles have images as background, make sure to add opacity: 1 !important; after .shortpoint-tile-bg-color {. For example, your code will look like this:

.shortpoint-tile:nth-child(1):hover .shortpoint-tile-bg-color {     opacity: 1 !important;     background-color: cyan !important;     transition: 500ms;}



Step 1: Edit the ShortPoint Web Part

  • Go to the SharePoint page you want to use and click Edit:


Edit


  • Click the close icon to remove the Toolbox:

close icon


  • Click the ShortPoint tag.
  • Select the Edit Properties icon:

Edit properties icon


Step 2: Copy the Code

  • Copy the Custom CSS code below:


.shortpoint-tile:nth-child(1):hover .shortpoint-tile-bg-color {     background-color: cyan !important;     transition: 500ms;}.shortpoint-tile:nth-child(2):hover .shortpoint-tile-bg-color {     background-color: red !important;     transition: 500ms;}.shortpoint-tile:nth-child(3):hover .shortpoint-tile-bg-color {     background-color: yellow!important;     transition: 500ms;}


NOTES
[1] If you have more than three items on your Tiles, simply add this line again:

.shortpoint-tile:nth-child(n):hover .shortpoint-tile-bg-color {     background-color: yellow!important;     transition: 500ms;}

Then, change n to the number that corresponds to the new item. For example, if we were to add a fourth item, the line of code would be as follows:

.shortpoint-tile:nth-child(4):hover .shortpoint-tile-bg-color {     background-color: yellow!important;     transition: 500ms;}

[2] If your Tiles have images as background, make sure to add opacity: 1 !important; after .shortpoint-tile-bg-color {. For example, your code will look like this:

.shortpoint-tile:nth-child(1):hover .shortpoint-tile-bg-color {     opacity: 1 !important;     background-color: cyan !important;     transition: 500ms;}



Step 3: Edit the Tiles Design Element


NOTEBefore proceeding, make sure you already have the Tiles Design Element on your page. To learn how to add it, check out How to Customize the Tiles Design Element.

Tiles design element


  • Click the Tiles tag:

Tiles tag


  • Select the cogwheel icon:


Cogwheel icon


Step 4: Paste the code

  • Click the next icon:


next icon

  • Navigate to the Custom CSS tab.
  • Paste the code.
  • Customize the background-color value of each item according to your preferences.


NOTEThe hover color will not be displayed on Tiles with dynamically connected content.

Step 5: Save


  • Once satisfied with your changes, click the green check mark.
  • Click the eye icon to see your page in real-time:


eye icon

  • Click Save to apply all your changes:


Save


That’s it! You can now add hover colors to your Tiles.


Related articles:

Did you find it helpful? Yes No

Send feedback
Sorry we couldn't be helpful. Help us improve this article with your feedback.

World's best intranet sites are designed using ShortPoint

Get started today! Learn more
See all 59 topics

Start a trial

Ignite your vision. Install ShortPoint directly on your site, or play in sandbox mode. No credit card required.

Get started today

World’s best intranet sites are designed using ShortPoint

Thousands of companies using ShortPoint everyday to design, brand and build award winning intranet sites.

Get started Learn more