Is there an explicit list of acceptable characters for uss selectors?

Hi all,

As the title suggests, wanted to see if there was any explicit list of acceptable characters for .uss selectors/class names.

I was using reflection to automatically generate visual class names, but I had to write a renaming workaround for Arrays and Lists because they were including the “[”, “]” and “`” characters, respectively.

For example, I could not figure out how to access the .CharactersAvailable[] selector, even though my UI Toolkit debugger told me that the UIElement was named this.

Is there a way to escape characters? Should the documentation be updated to mention what characters cannot be explicitly used?

Thanks all

Thanks for your feedback! We’ve updated our documentation to include the supported characters for USS selectors. You can check it out here: Unity - Manual: Introduction to USS.

1 Like