Is there a way to tell if a style is in use?

I am cleaning up some of my themes and want to delete unused styles. I was wondering if there was a way to figure out which styles are in use? Thanks.

Maybe not directly, but you could temporarily rename the style so if it was used, it wouldn’t match anymore after being renamed. Or temporarily make a significant change to the style like making the background and text red or something like that.

The downside to this approach is if the style was only applied in a very narrow scenario (like a specific unlikely attribute state), then it would be harder to catch.

Sending you a PM on a potential alternative approach though…

I’m also copying in a comment I shared with Simon via PM as it might be helpful to other people who find this thread in the future:

Just keep in mind that the concept of a named style being used by a tile is abstracted from any specific Theme. For example, you’ll always have a default and active style in every theme… and you could include any named style in multiple themes.

For example, you might choose to add a warning style across multiple themes. That enables you to set the warning style as the desired style for a tile and easily switch between two different themes that include the same named warning style.

So the tile on a dashboard is basically just saying “I want a warning style” and your Dashboard must be using a Theme that implements that named style for it to have any meaning.

  • For example, if you set a dashboard to have no theme, even though the tile said it wants a warning style, there would be no functional style applied to the tile since there was no Theme applied.
  • Similarly, if you switched to a theme that didn’t implement the warning style, then no functional styling for the tile asking for a warning style.

Thanks - very helpful. I had gotten into bad habits when creating themes. Initially I tried using the same theme for all dashboards on different devices.

But that got unwieldy so I started setting up a theme for each device - which seems to make a lot more sense.

I started by copying my “super theme” over to the device specific theme. So have a lot of unused styles depending on the device.

Hence the interest in cleaning this up.

1 Like