Sorry, I talk to myself too much and thought you were in the room on a similar topic before.
https://community.hubitat.com/t/custom-colors-for-specific-device-tile/155140/7
Most browsers today support the pseudo class :has which lets you define a selector based on relative elements. In the example I linked above, I was needing to change the background tile of specific tiles--not all of the devices using the same template which is what the JSON customization "customColors" option does for us.
So in your specific need, change the selector to something like:
#tile-335:has(.tile-primary.on) {
transform-origin: center;
animation-name: pulse;
animation: pulse 1s infinite ease-in-out alternate;
animation-duration: 1000ms; animation-iteration-count: infinite;
animation-timing-function: linear;
}
@keyframes pulse {from { transform: scale(0.8); }to {transform: scale(1.0); }}
Note: I assume from your previous example the the tile ID is 335