INTRODUCTION
IntroductionCore ConceptsGETTING STARTED
InstallationQuick startWhirl Compiler SettingsCORE CONCEPTS
Using Utility ClassesStyle FunctionsPseudo-Classes and statesResponsive DesignResponsive Base ElementThemeArbitrary ValuesLAYOUT
aspect-ratiodisplayoverflowpositionvisibilityobject-fittop / right / bottom / leftFLEXBOX
flex-basisflex-directionflex-wrapflexflex-growflex-shrinkgapjustify-contentalign-contentalign-itemsalign-selfSPACING
paddingmarginSIZING
widthmin-widthmax-widthheightmin-heightmax-heightTYPOGRAPHY
font-sizefont-styleauto-sizetext-outlineletter-spacingtext-aligncolorword-spacingparagraph-spacingtext-overflowoverflow-positionwhite-spaceBACKGROUND
background-colorbackground-imagebackground-positionbackground-repeatbackground-sizeBORDER
border-radiusborder-widthborder-colorEFFECTS
text-shadowopacityFILTER
Filterblurbrightnesscontrastgrayscalehue-rotateinvertsaturatesepiaTRANSITION
transition-propertytransition-durationtransition-timing-functiondelayTRANSFORM
rotatescaletransform-origintranslateArbitrary
This works similarly to TailwindCSS v4, but adapted to Unity’s restrictions and USS limitations. Unity USS has limited built-in functionality, and not every property/value combination can be predefined. Arbitrary let you:
- Use any color, including hex, rgba
- Use any length, including px, %
- Custom values for your custom control or niche values not added to whirl
- Prototype quickly without creating new utilities
Syntax in Scripts & UXML
Substitute symbols are only for use when directly modifying the uxml file or through the UI Builder. However, regular symbols like hover:bg-red can be used when using Element.AddClass(...) in C# or through the ScriptableObject Functions.
Also spaces should be replace with _ e.g, border-[2px_dashed_red]
Arbitrary Values
//value arbitrary
bg-[#ffff] //background-color: #ffff;
bg-[var(--color-red-200)] //background-color: var(--color-red-200);
text-[#ff00ff] //color: #ffff;
text-[20px] //font-size: 20px;Arbitrary Properties
//value properties
[background-color: #ffff] //background-color: #ffff;
hover:[background-color: var(--color-red-200)]
[color: #ff00ff] //color: #ffff;
[font-size: 20px] //font-size: 20px;