How do you implement a function that conditionally joins CSS class names together?

Technical