Sailwind

Library

A class-based UI framework for s&box, similar to Tailwind

Alex updated 1y ago 0 MB engine 17
thumb_up 16 open_in_new View on sbox.game

Sailwind

A categorical composition framework , similar to Tailwind, for sbox.
Not affiliated with the original Tailwind, but similar enough that you can reference the same documentation for properties.

Differences

  • Hover and active currently use "hover-" and "active-" prefixes (instead of "hover:" and "active:" respectively) due to some pending engine changes.
  • Most properties do not currently support custom values - only "bg-" and "font-" for now.

How to use it

Whatever panel component you use for UI should inherit "Sailwind.SailwindPanelComponent". Everything based on this root panel will then have access to Tailwind styles.

Example
@using Sandbox;
@using Sandbox.UI;
@inherits Panel
@namespace ShooterGame

<root>
    <column class="flex-col items-end bg-neutral-950">

        <div class="relative min-w-40 min-h-20 items-end text-6xl">

            @{ /* Background */ }
            <label class="absolute px-4 right-0 top-0 bottom-0 items-end opacity-25">
                054
            </label>

            @{ /* Foreground */ }
            <label class="absolute px-4 right-0 top-0 bottom-0 items-end">
                54
            </label>

        </div>

        @{ /* Bottom bar */ }
        <label class="text-sm uppercase bg-neutral-900 px-4 py-2 w-full items-end text-right">
            Health
        </label>

    </column>
</root>

@code
{
    protected override int BuildHash() => System.HashCode.Combine(Time.Now);

    public PlayerVitals PlayerVitals => Player.Local.Vitals;
    public string Health => $"{PlayerVitals.Health.CeilToInt()}";
    public string PaddedHealth => $"{PlayerVitals.Health.CeilToInt():D3}";
}


No usage statistics available
This package may be new or not widely used yet. Usage data becomes available as more users install and play with the package.
0 recorded entries
Rank Player Score Recorded
refresh
Discovering package leaderboards...
Package ID: alex.sailwind
Created: 2024-12-14 12:58 UTC
Updated: 2025-02-13 19:18 UTC
Type: library
Public: Yes
Version: 87486
files: 26
Size: 0.0 MB
Engine Version: 17
Asset Version ID: 87486
Version Created: 2025-02-13 19:18 UTC
Hash: 1791468372
Manifest: Open manifest
new_releases Latest Update Feb 13, 2025
Pointer-events
87486 Feb 13, 2025
Pointer-events
87485 Feb 13, 2025
Changes on 2025-02-13
81754 Dec 20, 2024
Namespace and class rename - Sailwind.SailwindPanelComponent
81043 Dec 14, 2024
Changes on 2024-12-14
info Live API Passthrough & Removal Notice

This file manifest and asset metadata are retrieved live directly from the official Facepunch s&box public API. s&box Explorer does not host, store, or redistribute any package files. All download links route directly to Facepunch CDN servers.