How to set the button color to be different according to the availability of its link

I’ve been struggling with this, hope to get some help here!

On my product dynamic page, there are buttons linking to different pdf files. However, not all products have that file available. Is there a way to only show the primary color on the button when the file is provided in the dataset?

In other words, if I didn’t upload any files to the content management page, the product that has the file available show blue (my primary color), and if not, show grey (inactive color).

Here is an example of the page:

Thank you!

So this would require coding that if the link is empty, it will be greyed out. Found a link on the Velo thread that’s a little similar to this question.

@Rob Thanks! I’ll take a look and see if I can apply it.

@lucytiao6 I found an example in the support articles you may be able to use since it’s the same principle.