Kostom.net

Whirl Compiler Settings

Whirl Compiler Settings (WCS) is the configuration system that replaces Tailwind’s tailwind.config.js. Instead of using configuration files or special syntax, Whirl uses ScriptableObjects so you can manage all compiler settings directly inside the Unity Editor. WCS controls how Whirl scans your project and where it outputs the generated USS utilities.

What Is a WCS?

A Whirl Compiler Settings asset tells the Whirl compiler:

  • Where to search: base paths to check for scripts/uxml to watch.
  • Final StyleSheet: This is the file that would contain all generated utilities from the specified base paths/base sub paths.
  • Compilation behaviour: You can have multiple WCS assets, allowing full separation of runtime, editor, tools, or package utilities.

Why Multiple WCS Assets?

This design lets you isolate utility groups:

  • Runtime vs Editor:
    Use one WCS for assets found in the Assets/ folder and another scanning Editor/ code.

  • Per-System Utilities:
    Example:
    • One WCS for UI Toolkit runtime UI
    • Another WCS for editor extensions
    • Another for tools or prototypes

  • Package-Friendly:
    If your project has internal Unity packages, each package can ship with its own WCS so it compiles only its own utilities.

Creating a WCS File

You can create a WCS file directly inside Unity by Right-click → Create → Kostom → Whirl Compiler Settings.

Specify one or more folders where Whirl will look for scripts and UXML files to watch for utilities. Then specify the output USS file where the generated styles will be written to.