库

s&box 库列表

Sailwind

alex.sailwind

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

关于

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}";
}

更多作品,作者: Alex

查看创作团队分析 →
01
Retro Shading Model 缩略图

Old-school shading model

+024小时
15收藏
15好评
85%Terry 评分
02
Iconify 缩略图
Iconifyalex.iconify

Easily integrate 150,000 icons

+024小时
15收藏
13好评
83%Terry 评分
03
Screen Space God Rays 缩略图
Screen Space God Raysalex.screenspacegodrays

No summary provided.

+024小时
6收藏
6好评
69%Terry 评分
04
Quick Asset Menu 缩略图
Quick Asset Menualex.quickassetmenu

No summary provided.

+024小时
4收藏
7好评
72%Terry 评分