My USS file is getting quite long. Does USS support includes, like:
@import url("filename.uss");
I can’t get it working, but I also don’t get error messages.
Perhaps I am using USS in an unintended way, if so do let me know. I found it simplest to import a single file at EditorWindow.OnEnable and add it to the root element instead of specific elements.
I know this thread is a couple years old, but for anyone coming from the web like myself, and to @cecarlsen if you’re still looking:
You can use multiple stylesheets in a single .uxml definition, like in the image below
It may not be your original ask, but there is also a .TSS theme file where you can specify multiple icons and stylesheets to create a theme. I would love to point you to a documentation page on how to use it but I am trying to find out myself in this thread:
Great, thanks for the update @jonathanma_unity ! I’ve noticed that there are two ways one can import an USS file into another - @import url("filename.uss"); and @import "filename.uss";. Is there a reason why one would chose former over the latter, or vice versa?
I was curious whether implementers (read: someone from Unity) can provide some behind-the-scenes insight. Maybe one approach takes two “hops”, while the other takes one. Maybe one was an afterthought and the other one was implemented by-the-book per the W3C spec. You know, something to break the analysis paralysis when faced with two equally good options.
I don’t remember the details of why both were implemented, but there is no difference between them. IIRC the UI Builder always outputs @import url so I would say that’s the standard approach.