If you have a navigation menu and want to change the background of that item based on the current page (e.g. highlight the active link), you can achieve this in the Data tab:
Select the link layer of your navigation menu
In the Data tab, add a new binding
Add the property
window.location.pathname.includes('/insertYourUrlPathHere') ? 'insert-whatever-active-color-you-want' : 'insert-whatever-default-color-you-want'. You’ll want to adjust the portion /insertYourUrlPathHere to include the path the particular link routes, such as ‘/home’, as well as adjust the colors to match your theme (e.g. ‘blue’ or ‘rgba(0, 0, 0, 0.8)’ or ‘#fafafa’
- Repeat these steps for each link in your navigation menu adjusting the path accordingly.
In this particular example, the background color becomes red when someone navigates to that page. You can also adjust the styling in other ways, such as changing the color of the font, opacity, etc. You would just need to substitute the proper binding for whatever css property it is you want to change. For example, font color would be style.color, opacity would be style.opacity, etc.