Documentation ¶
Index ¶
Constants ¶
const ( // Flags for content dependent dimensions DimenContentMax uint32 = 0x0010 DimenContentMin uint32 = 0x0020 DimenContentFit uint32 = 0x0030 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DimenPatterns ¶
type DimenPatterns[T any] struct { Auto T Inherit T Initial T Just T Default T }
type DimenPatterns[T any] map[*MatchExpr[T]]T
type DimenT ¶
type DimenT struct {
// contains filtered or unexported fields
}
DimenT is an option type for CSS dimensions.
func DimenOption ¶
DimenOption returns an optional dimension type from a property string. It will never return an error, even with illegal input, but instead will then return an unset dimension.
func ParseDimen ¶
ParseDimen parses a string to return an optional dimension. Syntax is CSS Unit. Valid dimensions are
15px 80% -33rem
func Percentage ¶
func Percentage(n Percent) DimenT
Percentage creates a CSS dimension with a %-relative value.
func (DimenT) IsAbsolute ¶
IsAbsolute returns true if d represents a valid absolute dimension.
func (DimenT) IsRelative ¶
IsRelative returns true if d represents a valid relative dimension (`%`, `em`, etc.).
func (DimenT) UnitString ¶
UnitString returns 'sp' (scaled points) for non-relative dimensions and a string denoting the defined unit for relative dimensions.
type MatchExpr ¶
type MatchExpr[T any] struct { // contains filtered or unexported fields }
func DimenPattern ¶
func (*MatchExpr[T]) OneOf ¶
func (m *MatchExpr[T]) OneOf(patterns DimenPatterns[T]) T