Code/Demos/DemoTokens.cs
using Goo;
using Sandbox.UI;
namespace Sandbox;
// Goo design tokens mirrored from goo_design_tokens.json. Update both together.
// Voice rules (lowercase chrome, no em-dashes, no forbidden words, no red, no pill buttons)
// cannot be encoded here. The demos enforce them by hand.
internal static class DemoTokens
{
// -------- brand --------
public static readonly Color Ink = Color.FromBytes(0x09, 0x0B, 0x10, 255);
public static readonly Color Bone = Color.FromBytes(0xEC, 0xED, 0xED, 255);
public static readonly Color White = Color.FromBytes(0xFF, 0xFF, 0xFF, 255);
public static readonly Color Black = Color.FromBytes(0x00, 0x00, 0x00, 255);
// -------- accents (sampled from goo svg assets) --------
public static readonly Color AccentBlue = Color.FromBytes(0x47, 0x8A, 0xD1, 255);
public static readonly Color AccentBlueSoft = Color.FromBytes(0x6F, 0xA6, 0xDE, 255);
public static readonly Color AccentGreen = Color.FromBytes(0x6C, 0xBC, 0x5F, 255);
public static readonly Color AccentOrange = Color.FromBytes(0xEF, 0x6A, 0x4D, 255);
public static readonly Color AccentOrangeSoft = Color.FromBytes(0xF4, 0x8A, 0x52, 255);
public static readonly Color AccentYellow = Color.FromBytes(0xF9, 0xA2, 0x38, 255);
// -------- ink scale (rungs consumed by demos) --------
public static readonly Color Ink0 = Color.FromBytes(0x09, 0x0B, 0x10, 255);
public static readonly Color Ink1 = Color.FromBytes(0x11, 0x14, 0x1B, 255);
public static readonly Color Ink2 = Color.FromBytes(0x18, 0x1C, 0x25, 255);
public static readonly Color Ink3 = Color.FromBytes(0x23, 0x28, 0x34, 255);
public static readonly Color Ink7 = Color.FromBytes(0x90, 0x99, 0xA8, 255);
public static readonly Color Ink8 = Color.FromBytes(0xB8, 0xBF, 0xC9, 255);
public static readonly Color Ink10 = Color.FromBytes(0xEC, 0xED, 0xED, 255);
public static readonly Color Ink11 = Color.FromBytes(0xF5, 0xF6, 0xF7, 255);
// -------- semantic foreground --------
public static readonly Color FgPrimary = Ink10;
public static readonly Color FgSecondary = Ink8;
public static readonly Color FgTertiary = Ink7;
public static readonly Color FgInverse = Ink0;
// -------- semantic background --------
public static readonly Color BgBase = Ink0;
public static readonly Color BgRaised = Ink1;
public static readonly Color BgCard = Ink2;
public static readonly Color BgCardHi = Ink3;
public static readonly Color BgLight = Ink11;
public static readonly Color HoverGlow = Color.FromBytes(0x32, 0x55, 0x80, 255); // BgCardHi tinted toward AccentBlue
// -------- borders (semi-transparent; precomputed alpha = round(255 * x)) --------
public static readonly Color Border1 = new Color(1f, 1f, 1f, 0.08f);
public static readonly Color Border2 = new Color(1f, 1f, 1f, 0.14f);
public static readonly Color BorderOnLight1 = new Color(0.035f, 0.043f, 0.063f, 0.08f);
public static readonly Color BorderOnLight2 = new Color(0.035f, 0.043f, 0.063f, 0.14f);
// -------- semantic state (alias accents) --------
public static readonly Color Info = AccentBlue;
public static readonly Color Positive = AccentGreen;
public static readonly Color Warning = AccentYellow;
public static readonly Color Danger = AccentOrange;
// -------- accent aliases --------
public static readonly Color Accent = AccentBlue;
public static readonly Color AccentSoft = AccentBlueSoft;
public static readonly Color TextOnAccent = Ink;
// -------- spacing (4-step scale) --------
public static readonly Length Space1 = Px.Of(4);
public static readonly Length Space2 = Px.Of(8);
public static readonly Length Space3 = Px.Of(12);
public static readonly Length Space4 = Px.Of(16);
public static readonly Length Space5 = Px.Of(24);
public static readonly Length Space6 = Px.Of(32);
public static readonly Length Space7 = Px.Of(48);
public static readonly Length Space8 = Px.Of(64);
// -------- radii (pill defined-but-not-for-use; blob unrepresentable) --------
public static readonly Length Radius1 = 6f;
public static readonly Length Radius2 = 10f;
public static readonly Length Radius3 = 14f;
public static readonly Length Radius4 = 20f;
// -------- font sizes --------
public static readonly Length FontH1 = 48f;
public static readonly Length FontH2 = 36f;
public static readonly Length FontH3 = 28f;
public static readonly Length FontH4 = 22f;
public static readonly Length FontH5 = 18f;
public static readonly Length FontH6 = 15f;
public static readonly Length FontBodyLg = 18f;
public static readonly Length FontBody = 16f;
public static readonly Length FontBodySm = 14f;
public static readonly Length FontCaption = 13f;
// -------- line heights (precomputed; LineHeight is Length not multiplier) --------
public static readonly Length LineH1Tight = 50f; // 48 * 1.05
public static readonly Length LineH2Snug = 43f; // 36 * 1.20
public static readonly Length LineH3Snug = 34f; // 28 * 1.20
public static readonly Length LineH4Snug = 26f; // 22 * 1.20
public static readonly Length LineBodyRelaxed = 26f; // 16 * 1.60
public static readonly Length LineBodyBase = 23f; // 16 * 1.45
public static readonly Length LineCaption = 19f; // 13 * 1.45
// -------- letter spacing (precomputed; LetterSpacing is Length not em) --------
public static readonly Length TrackingTightH1 = -1f; // -0.02em * 48 ~= -0.96
public static readonly Length TrackingTightH2 = -1f; // -0.02em * 36 ~= -0.72
public static readonly Length TrackingWider13 = 2f; // 0.14em * 13 ~= 1.82
// -------- font weights --------
public const int WeightRegular = 400;
public const int WeightMedium = 500;
public const int WeightSemibold = 600;
public const int WeightBold = 700;
// -------- font families (FontFamily is single string, no fallback chain) --------
public const string FontDisplay = "Space Grotesk";
public const string FontUI = "Vend Sans";
public const string FontUILabel = "Didact Gothic";
}