How would you make an USS documentation for your framework?

Hello,

I’m asking myself: my team and I are working on a huge design system (made in Figma) which we are implementing in an UITK theme. This theme is an USS file importing each components (also USS files).

It works pretty well, but we are facing a large amount of components, like building a framework. And I want to know how some of you handle this? How do you document your “library”? Did you make a framework documentation like Boostrap/Foundation (in html/css)?

For the purposes of documenting software (I’ve never tried CSS; don’t know how different it is), my general go-to is to use markdown (with liberal use of screenshots). This is easy to diff/checkin to source control, and is generally pretty well-liked by coders. You can then use pandoc to convert this to HTML/PDF with whatever styling you like. The problem with markdown is you have very little control over formatting or styles. But the good thing about markdown is you don’t need to worry about formatting or styles :stuck_out_tongue_winking_eye:

The alternative workflow of some companies is to use a wiki, which is great for internal-only communication and docs, and has a visual editor, so may be more well-liked by non-coders. It’s also has a sort of built-in source control, so if you’re not using git (or have tons of microrepos and want onr place for docs), that can be an option. It can be tricky to export to show to customers, though.

At least where I’ve worked, I found that any documentation or design docs on wikis were out of date; they’d be published there first, discussed, updated, etc, until the project actually got underway. As soon as the first line of non-prototype code got written, the wiki stopped being updated by engineers. A markdown file in the repo sitting right there next to the code has a much better chance of being updated as you work.

Also, a quick warning regarding USS in Unity: any comments you make on USS files can be stripped by the UI Builder. Like all you need to do is open and save any UXML file, and every USS it references will be reformatted and lose all formatting. So any documentation generator based on parsing comments (eg Doxygen and the like) is doomed to fail unless you make it a point to never touch UI Builder.