Auto-generated partial style class for a PolygonNode in the Goo.Authoring namespace. It declares nullable style properties (sizes, spacing, colors, layout, etc.) and a WithStyles method that resolves those properties into a Goo.Polygon record by calling ResolveStyleValue and BuildStyleTransform.
// <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 PolygonNode
{
/// <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>Overrides the parent's AlignItems for this one child.</summary>
[Property, GooToken, Group( "Layout" ), Order( 10 ), Editor( "goo-nullable-enum" )] public Align? AlignSelf { 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>Bottom-edge offset; applied only when Position is Relative or Absolute.</summary>
[Property, GooToken, Group( "Position Offsets" ), Order( 40 ), Hide] public GooLength? Bottom { get; set; }
/// <summary>Left-edge offset; applied only when Position is Relative or Absolute.</summary>
[Property, GooToken, Group( "Position Offsets" ), Order( 40 ), Editor( "goo-side-lengths" ), Title( "Position Offsets" )] public GooLength? Left { get; set; }
/// <summary>Right-edge offset; applied only when Position is Relative or Absolute.</summary>
[Property, GooToken, Group( "Position Offsets" ), Order( 40 ), Hide] public GooLength? Right { get; set; }
/// <summary>Top-edge offset; applied only when Position is Relative or Absolute.</summary>
[Property, GooToken, Group( "Position Offsets" ), Order( 40 ), Hide] public GooLength? Top { 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>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>Whether the element receives pointer input (All or None).</summary>
[Property, GooToken, Group( "Misc", StartFolded = true ), Order( 200 ), Editor( "goo-nullable-enum" )] public PointerEvents? PointerEvents { get; set; }
/// <summary>Positioning scheme: Relative offsets from the normal slot, Absolute lifts the box out of flow against the nearest positioned ancestor.</summary>
[Property, GooToken, Group( "Layout" ), Order( 10 ), Editor( "goo-nullable-enum" )] public PositionMode? Position { get; set; }
/// <summary>Stacking order among overlapping siblings; higher draws on top.</summary>
[Property, GooToken, Group( "Layout" ), Order( 10 ), Editor( "goo-integer" )] public int? ZIndex { 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>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.Polygon WithStyles( Goo.Polygon 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 ),
AlignSelf = ResolveStyleValue( nameof( AlignSelf ), AlignSelf ),
BackgroundTint = ResolveStyleValue( nameof( BackgroundTint ), BackgroundTint ),
Bottom = ResolveStyleValue( nameof( Bottom ), Bottom ),
Left = ResolveStyleValue( nameof( Left ), Left ),
Right = ResolveStyleValue( nameof( Right ), Right ),
Top = ResolveStyleValue( nameof( Top ), Top ),
FlexBasis = ResolveStyleValue( nameof( FlexBasis ), FlexBasis ),
FlexGrow = ResolveStyleValue( nameof( FlexGrow ), FlexGrow ),
FlexShrink = ResolveStyleValue( nameof( FlexShrink ), FlexShrink ),
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 ),
PointerEvents = ResolveStyleValue( nameof( PointerEvents ), PointerEvents ),
Position = ResolveStyleValue( nameof( Position ), Position ),
ZIndex = ResolveStyleValue( nameof( ZIndex ), ZIndex ),
HoverBackgroundColor = ResolveStyleValue( nameof( HoverBackgroundColor ), HoverBackgroundColor ),
TransitionMs = ResolveStyleValue( nameof( TransitionMs ), TransitionMs ),
Transform = BuildStyleTransform(),
};
}