Class name cannot contain spaces

I’m trying to create a CSS constant like this public static final String BACK_TO_TOP_ICON = "back-to-top i"; and the CSS is .back-to-top i { padding-top: 15px; font-size: 16px }. I’m not sure what is wrong here when the same is working fine in the browser as shown here. How to declare the CSS constant now? or how to fix this error?

Looks we cannot declare like that. Need to concatenate two CSS constants and the space is getting added automatically

like this icon.addClassNames(CSSUtility.Common.BACK_TO_TOP,CSSUtility.Common.BACK_TO_TOP_ICON);

If there is a space between, it’s 2 classnames back-to-top and i

. back-to-top i in your css will select a element i inside another element with a classname . back-to-top. That’s probably wrong