Partial generated style class for a TextNode, declaring nullable style properties (sizes, spacing, background, font, text, state variants) and a WithStyles method that applies resolved style values to a Goo.Text record via a with-expression.
// <auto-generated by tools/StyleFacadeEmit from style-manifest.json; do not edit />
using Goo;
using Sandbox;
using Sandbox.Rendering;
using Sandbox.UI;
namespace Goo.Authoring;
public partial class TextNode
{
/// <summary>Width of the box (Length: px, %, em, rem, ...).</summary>
[Property, GooToken, Group( "Sizing" ), Order( 20 ), Range( 0f, float.MaxValue, true, false ), Editor( "goo-axis-lengths" ), Title( "Size" )] public GooLength? Width { get; set; }
/// <summary>Height of the box.</summary>
[Property, GooToken, Group( "Sizing" ), Order( 20 ), Range( 0f, float.MaxValue, true, false ), Hide] public GooLength? Height { get; set; }
/// <summary>Outer space on all four edges, between this box and its neighbors.</summary>
[Property, GooToken, Group( "Spacing" ), Order( 30 )] public GooLength? Margin { get; set; }
/// <summary>Outer space on the left edge.</summary>
[Property, GooToken, Group( "Spacing" ), Order( 30 ), Editor( "goo-side-lengths" ), Title( "Margin Sides" )] public GooLength? MarginLeft { get; set; }
/// <summary>Outer space on the top edge.</summary>
[Property, GooToken, Group( "Spacing" ), Order( 30 ), Hide] public GooLength? MarginTop { get; set; }
/// <summary>Outer space on the right edge.</summary>
[Property, GooToken, Group( "Spacing" ), Order( 30 ), Hide] public GooLength? MarginRight { get; set; }
/// <summary>Outer space on the bottom edge.</summary>
[Property, GooToken, Group( "Spacing" ), Order( 30 ), Hide] public GooLength? MarginBottom { get; set; }
/// <summary>Fill color behind the content.</summary>
[Property, GooToken, Group( "Background" ), Order( 60 )] public Color? BackgroundColor { get; set; }
/// <summary>Multiplies the background image color; default white (no tint).</summary>
[Property, GooToken, Group( "Background" ), Order( 60 )] public Color? BackgroundTint { get; set; }
/// <summary>Initial main-axis size of a flex child before grow and shrink are applied.</summary>
[Property, GooToken, Group( "Layout" ), Order( 10 ), Range( 0f, float.MaxValue, true, false )] public GooLength? FlexBasis { get; set; }
/// <summary>Share of leftover main-axis space this child claims; 0 (default) means do not grow.</summary>
[Property, GooToken, Group( "Layout" ), Order( 10 ), Editor( "goo-float" ), Range( 0f, float.MaxValue, true, false ), Step( 0.1f )] public float? FlexGrow { get; set; }
/// <summary>How readily this child shrinks when space is tight; 0 pins it to its basis.</summary>
[Property, GooToken, Group( "Layout" ), Order( 10 ), Editor( "goo-float" ), Range( 0f, float.MaxValue, true, false ), Step( 0.1f )] public float? FlexShrink { get; set; }
/// <summary>Text color (s&box uses font-color, not the CSS color property).</summary>
[Property, GooToken, Group( "Font" ), Order( 90 )] public Color? FontColor { get; set; }
/// <summary>Font face name.</summary>
[Property, GooToken, Group( "Font" ), Order( 90 ), FontName] public string FontFamily { get; set; }
/// <summary>Text size.</summary>
[Property, GooToken, Group( "Font" ), Order( 90 ), Range( 0f, float.MaxValue, true, false )] public GooLength? FontSize { get; set; }
/// <summary>Text antialiasing hint (Auto, Never, Always).</summary>
[Property, GooToken, Group( "Font" ), Order( 90 ), Editor( "goo-nullable-enum" )] public FontSmooth? FontSmooth { get; set; }
/// <summary>Italic or oblique styling.</summary>
[Property, GooToken, Group( "Font" ), Order( 90 ), Editor( "goo-nullable-enum" )] public FontStyle? FontStyle { get; set; }
/// <summary>Numeric glyph variant, e.g. TabularNums for fixed-width digits.</summary>
[Property, GooToken, Group( "Font" ), Order( 90 ), Editor( "goo-nullable-enum" )] public FontVariantNumeric? FontVariantNumeric { get; set; }
/// <summary>Boldness from 100 to 900 (400 normal, 700 bold).</summary>
[Property, GooToken, Group( "Font" ), Order( 90 ), Editor( "goo-font-weight" )] public int? FontWeight { get; set; }
/// <summary>Extra space between characters.</summary>
[Property, GooToken, Group( "Text" ), Order( 100 )] public GooLength? LetterSpacing { get; set; }
/// <summary>Height of each line of text (default 100%).</summary>
[Property, GooToken, Group( "Text" ), Order( 100 ), Range( 0f, float.MaxValue, true, false )] public GooLength? LineHeight { get; set; }
/// <summary>Upper bound on height.</summary>
[Property, GooToken, Group( "Sizing" ), Order( 20 ), Range( 0f, float.MaxValue, true, false ), Hide] public GooLength? MaxHeight { get; set; }
/// <summary>Upper bound on width; the box never grows past it.</summary>
[Property, GooToken, Group( "Sizing" ), Order( 20 ), Range( 0f, float.MaxValue, true, false ), Editor( "goo-axis-lengths" ), Title( "Maximum Size" )] public GooLength? MaxWidth { get; set; }
/// <summary>Lower bound on height.</summary>
[Property, GooToken, Group( "Sizing" ), Order( 20 ), Range( 0f, float.MaxValue, true, false ), Hide] public GooLength? MinHeight { get; set; }
/// <summary>Lower bound on width; the box never shrinks below it.</summary>
[Property, GooToken, Group( "Sizing" ), Order( 20 ), Range( 0f, float.MaxValue, true, false ), Editor( "goo-axis-lengths" ), Title( "Minimum Size" )] public GooLength? MinWidth { get; set; }
/// <summary>Overall opacity from 0 (transparent) to 1 (opaque).</summary>
[Property, GooToken, Group( "Effects", StartFolded = true ), Order( 120 ), Editor( "goo-float" ), Range( 0f, 1f, true, true ), Step( 0.01f )] public float? Opacity { get; set; }
/// <summary>Horizontal alignment of text within its box.</summary>
[Property, GooToken, Group( "Text" ), Order( 100 ), Editor( "goo-nullable-enum" )] public TextAlign? TextAlign { get; set; }
/// <summary>Angle in radians for a gradient fill painted onto the text.</summary>
[Property, GooToken, Group( "Text" ), Order( 100 ), Editor( "goo-float" ), Title( "Text Background Angle (Radians)" ), Step( 0.01f )] public float? TextBackgroundAngle { get; set; }
/// <summary>Color of the underline, overline, or line-through.</summary>
[Property, GooToken, Group( "Text" ), Order( 100 )] public Color? TextDecorationColor { get; set; }
/// <summary>Which decoration lines to draw (underline, overline, line-through; flags).</summary>
[Property, GooToken, Group( "Text" ), Order( 100 )] public TextDecoration? TextDecorationLine { get; set; }
/// <summary>Whether decoration lines skip over glyph descenders.</summary>
[Property, GooToken, Group( "Text" ), Order( 100 ), Editor( "goo-nullable-enum" )] public TextSkipInk? TextDecorationSkipInk { get; set; }
/// <summary>Decoration line style (solid, double, dotted, dashed, wavy).</summary>
[Property, GooToken, Group( "Text" ), Order( 100 ), Editor( "goo-nullable-enum" )] public TextDecorationStyle? TextDecorationStyle { get; set; }
/// <summary>Thickness of the decoration line.</summary>
[Property, GooToken, Group( "Text" ), Order( 100 ), Range( 0f, float.MaxValue, true, false )] public GooLength? TextDecorationThickness { get; set; }
/// <summary>Texture filtering mode used when rendering text.</summary>
[Property, GooToken, Group( "Text" ), Order( 100 ), Editor( "goo-nullable-enum" )] public FilterMode? TextFilter { get; set; }
/// <summary>Vertical offset of the line-through.</summary>
[Property, GooToken, Group( "Text" ), Order( 100 )] public GooLength? TextLineThroughOffset { get; set; }
/// <summary>How clipped text is signalled (None, Ellipsis, Clip).</summary>
[Property, GooToken, Group( "Text" ), Order( 100 ), Editor( "goo-nullable-enum" )] public TextOverflow? TextOverflow { get; set; }
/// <summary>Vertical offset of the overline.</summary>
[Property, GooToken, Group( "Text" ), Order( 100 )] public GooLength? TextOverlineOffset { get; set; }
/// <summary>Color of the text outline stroke.</summary>
[Property, GooToken, Group( "Text" ), Order( 100 )] public Color? TextStrokeColor { get; set; }
/// <summary>Width of the text outline stroke.</summary>
[Property, GooToken, Group( "Text" ), Order( 100 ), Range( 0f, float.MaxValue, true, false )] public GooLength? TextStrokeWidth { get; set; }
/// <summary>Case transform applied at render (Uppercase, Lowercase, Capitalize).</summary>
[Property, GooToken, Group( "Text" ), Order( 100 ), Editor( "goo-nullable-enum" )] public TextTransform? TextTransform { get; set; }
/// <summary>Vertical offset of the underline.</summary>
[Property, GooToken, Group( "Text" ), Order( 100 )] public GooLength? TextUnderlineOffset { get; set; }
/// <summary>Whitespace and wrapping handling (Normal, NoWrap, Pre, PreLine).</summary>
[Property, GooToken, Group( "Text" ), Order( 100 ), Editor( "goo-nullable-enum" )] public WhiteSpace? WhiteSpace { get; set; }
/// <summary>Whether long words may break mid-word to avoid overflow.</summary>
[Property, GooToken, Group( "Text" ), Order( 100 ), Editor( "goo-nullable-enum" )] public WordBreak? WordBreak { get; set; }
/// <summary>Extra space between words.</summary>
[Property, GooToken, Group( "Text" ), Order( 100 )] public GooLength? WordSpacing { get; set; }
/// <summary>BackgroundColor while the pointer is over the element.</summary>
[Property, GooToken, Group( "State Variants", StartFolded = true ), Order( 110 )] public Color? HoverBackgroundColor { get; set; }
/// <summary>BackgroundColor while the element is pressed.</summary>
[Property, GooToken, Group( "State Variants", StartFolded = true ), Order( 110 )] public Color? ActiveBackgroundColor { get; set; }
/// <summary>BackgroundColor while the element has focus.</summary>
[Property, GooToken, Group( "State Variants", StartFolded = true ), Order( 110 )] public Color? FocusBackgroundColor { get; set; }
/// <summary>FontColor while the pointer is over the element.</summary>
[Property, GooToken, Group( "State Variants", StartFolded = true ), Order( 110 )] public Color? HoverFontColor { get; set; }
/// <summary>FontColor while the element is pressed.</summary>
[Property, GooToken, Group( "State Variants", StartFolded = true ), Order( 110 )] public Color? ActiveFontColor { get; set; }
/// <summary>FontColor while the element has focus.</summary>
[Property, GooToken, Group( "State Variants", StartFolded = true ), Order( 110 )] public Color? FocusFontColor { get; set; }
/// <summary>Duration in milliseconds for the Hover/Active/Focus color transitions.</summary>
[Property, GooToken, Group( "State Variants", StartFolded = true ), Order( 110 ), Editor( "goo-integer" ), Range( 0, int.MaxValue, true, false ), Step( 1 )] public int? TransitionMs { get; set; }
Goo.Text WithStyles( Goo.Text blob ) => blob with
{
Width = ResolveStyleValue( nameof( Width ), Width ),
Height = ResolveStyleValue( nameof( Height ), Height ),
Margin = ResolveStyleValue( nameof( Margin ), Margin ),
MarginLeft = ResolveStyleValue( nameof( MarginLeft ), MarginLeft ),
MarginTop = ResolveStyleValue( nameof( MarginTop ), MarginTop ),
MarginRight = ResolveStyleValue( nameof( MarginRight ), MarginRight ),
MarginBottom = ResolveStyleValue( nameof( MarginBottom ), MarginBottom ),
BackgroundColor = ResolveStyleValue( nameof( BackgroundColor ), BackgroundColor ),
BackgroundTint = ResolveStyleValue( nameof( BackgroundTint ), BackgroundTint ),
FlexBasis = ResolveStyleValue( nameof( FlexBasis ), FlexBasis ),
FlexGrow = ResolveStyleValue( nameof( FlexGrow ), FlexGrow ),
FlexShrink = ResolveStyleValue( nameof( FlexShrink ), FlexShrink ),
FontColor = ResolveStyleValue( nameof( FontColor ), FontColor ),
FontFamily = ResolveStyleValue( nameof( FontFamily ), string.IsNullOrEmpty( FontFamily ) ? null : FontFamily ),
FontSize = ResolveStyleValue( nameof( FontSize ), FontSize ),
FontSmooth = ResolveStyleValue( nameof( FontSmooth ), FontSmooth ),
FontStyle = ResolveStyleValue( nameof( FontStyle ), FontStyle ),
FontVariantNumeric = ResolveStyleValue( nameof( FontVariantNumeric ), FontVariantNumeric ),
FontWeight = ResolveStyleValue( nameof( FontWeight ), FontWeight ),
LetterSpacing = ResolveStyleValue( nameof( LetterSpacing ), LetterSpacing ),
LineHeight = ResolveStyleValue( nameof( LineHeight ), LineHeight ),
MaxHeight = ResolveStyleValue( nameof( MaxHeight ), MaxHeight ),
MaxWidth = ResolveStyleValue( nameof( MaxWidth ), MaxWidth ),
MinHeight = ResolveStyleValue( nameof( MinHeight ), MinHeight ),
MinWidth = ResolveStyleValue( nameof( MinWidth ), MinWidth ),
Opacity = ResolveStyleValue( nameof( Opacity ), Opacity ),
TextAlign = ResolveStyleValue( nameof( TextAlign ), TextAlign ),
TextBackgroundAngle = ResolveStyleValue( nameof( TextBackgroundAngle ), TextBackgroundAngle ),
TextDecorationColor = ResolveStyleValue( nameof( TextDecorationColor ), TextDecorationColor ),
TextDecorationLine = ResolveStyleValue( nameof( TextDecorationLine ), TextDecorationLine ),
TextDecorationSkipInk = ResolveStyleValue( nameof( TextDecorationSkipInk ), TextDecorationSkipInk ),
TextDecorationStyle = ResolveStyleValue( nameof( TextDecorationStyle ), TextDecorationStyle ),
TextDecorationThickness = ResolveStyleValue( nameof( TextDecorationThickness ), TextDecorationThickness ),
TextFilter = ResolveStyleValue( nameof( TextFilter ), TextFilter ),
TextLineThroughOffset = ResolveStyleValue( nameof( TextLineThroughOffset ), TextLineThroughOffset ),
TextOverflow = ResolveStyleValue( nameof( TextOverflow ), TextOverflow ),
TextOverlineOffset = ResolveStyleValue( nameof( TextOverlineOffset ), TextOverlineOffset ),
TextStrokeColor = ResolveStyleValue( nameof( TextStrokeColor ), TextStrokeColor ),
TextStrokeWidth = ResolveStyleValue( nameof( TextStrokeWidth ), TextStrokeWidth ),
TextTransform = ResolveStyleValue( nameof( TextTransform ), TextTransform ),
TextUnderlineOffset = ResolveStyleValue( nameof( TextUnderlineOffset ), TextUnderlineOffset ),
WhiteSpace = ResolveStyleValue( nameof( WhiteSpace ), WhiteSpace ),
WordBreak = ResolveStyleValue( nameof( WordBreak ), WordBreak ),
WordSpacing = ResolveStyleValue( nameof( WordSpacing ), WordSpacing ),
HoverBackgroundColor = ResolveStyleValue( nameof( HoverBackgroundColor ), HoverBackgroundColor ),
ActiveBackgroundColor = ResolveStyleValue( nameof( ActiveBackgroundColor ), ActiveBackgroundColor ),
FocusBackgroundColor = ResolveStyleValue( nameof( FocusBackgroundColor ), FocusBackgroundColor ),
HoverFontColor = ResolveStyleValue( nameof( HoverFontColor ), HoverFontColor ),
ActiveFontColor = ResolveStyleValue( nameof( ActiveFontColor ), ActiveFontColor ),
FocusFontColor = ResolveStyleValue( nameof( FocusFontColor ), FocusFontColor ),
TransitionMs = ResolveStyleValue( nameof( TransitionMs ), TransitionMs ),
Transform = BuildStyleTransform(),
};
}