properties

package
v0.0.13 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 17, 2025 License: BSD-3-Clause Imports: 5 Imported by: 0

Documentation

Overview

This package defines the types needed to handle the various CSS properties. There are 3 groups of types for a property, separated by 2 steps : cascading and computation. Thus the need of 3 types (see below). Schematically, the style computation is :

ValidatedProperty (ComputedFromCascaded)-> CascadedProperty (Compute)-> CssProperty

Index

Constants

View Source
const (
	RepeatAutoFill = -1
	RepeatAutoFit  = -2
)
View Source
const (
	True  = Bool(true)
	False = Bool(false)
)
View Source
const (
	// AutoF indicates a value specified as "auto", which will
	// be resolved during layout.
	AutoF special = true
)

Variables

View Source
var (
	ZeroPixels = Dimension{Unit: Px}

	CurrentColor = Color{Type: parser.ColorCurrentColor}
	// How many CSS pixels is one <unit>?
	// http://www.w3.org/TR/CSS21/syndata.html#length-units
	LengthsToPixels = map[Unit]Float{
		Px: 1,
		Pt: 1. / 0.75,
		Pc: 16.,
		In: 96.,
		Cm: 96. / 2.54,
		Mm: 96. / 25.4,
		Q:  96. / 25.4 / 4.,
	}

	// Value in pixels of font-size for <absolute-size> keywords: 12pt (16px) for
	// medium, and scaling factors given in CSS3 for others:
	// http://www.w3.org/TR/css3-fonts/#font-size-prop
	FontSizeKeywords = map[string]Float{
		"xx-small": InitialValues.GetFontSize().Value * 3 / 5,
		"x-small":  InitialValues.GetFontSize().Value * 3 / 4,
		"small":    InitialValues.GetFontSize().Value * 8 / 9,
		"medium":   InitialValues.GetFontSize().Value * 1 / 1,
		"large":    InitialValues.GetFontSize().Value * 6 / 5,
		"x-large":  InitialValues.GetFontSize().Value * 3 / 2,
		"xx-large": InitialValues.GetFontSize().Value * 2 / 1,
	}
	FontSizeKeywordsOrder = []string{"xx-small", "x-small", "small", "medium", "large", "x-large", "xx-large"}

	// http://www.w3.org/TR/css3-page/#size
	PageSizes = map[string]Point{
		"a10":     {Dimension{Value: 26, Unit: Mm}, Dimension{Value: 37, Unit: Mm}},
		"a9":      {Dimension{Value: 37, Unit: Mm}, Dimension{Value: 52, Unit: Mm}},
		"a8":      {Dimension{Value: 52, Unit: Mm}, Dimension{Value: 74, Unit: Mm}},
		"a7":      {Dimension{Value: 74, Unit: Mm}, Dimension{Value: 105, Unit: Mm}},
		"a6":      {Dimension{Value: 105, Unit: Mm}, Dimension{Value: 148, Unit: Mm}},
		"a5":      {Dimension{Value: 148, Unit: Mm}, Dimension{Value: 210, Unit: Mm}},
		"a4":      A4,
		"a3":      {Dimension{Value: 297, Unit: Mm}, Dimension{Value: 420, Unit: Mm}},
		"a2":      {Dimension{Value: 420, Unit: Mm}, Dimension{Value: 594, Unit: Mm}},
		"a1":      {Dimension{Value: 594, Unit: Mm}, Dimension{Value: 841, Unit: Mm}},
		"a0":      {Dimension{Value: 841, Unit: Mm}, Dimension{Value: 1189, Unit: Mm}},
		"b10":     {Dimension{Value: 31, Unit: Mm}, Dimension{Value: 44, Unit: Mm}},
		"b9":      {Dimension{Value: 44, Unit: Mm}, Dimension{Value: 62, Unit: Mm}},
		"b8":      {Dimension{Value: 62, Unit: Mm}, Dimension{Value: 88, Unit: Mm}},
		"b7":      {Dimension{Value: 88, Unit: Mm}, Dimension{Value: 125, Unit: Mm}},
		"b6":      {Dimension{Value: 125, Unit: Mm}, Dimension{Value: 176, Unit: Mm}},
		"b5":      {Dimension{Value: 176, Unit: Mm}, Dimension{Value: 250, Unit: Mm}},
		"b4":      {Dimension{Value: 250, Unit: Mm}, Dimension{Value: 353, Unit: Mm}},
		"b3":      {Dimension{Value: 353, Unit: Mm}, Dimension{Value: 500, Unit: Mm}},
		"b2":      {Dimension{Value: 500, Unit: Mm}, Dimension{Value: 707, Unit: Mm}},
		"b1":      {Dimension{Value: 707, Unit: Mm}, Dimension{Value: 1000, Unit: Mm}},
		"b0":      {Dimension{Value: 1000, Unit: Mm}, Dimension{Value: 1414, Unit: Mm}},
		"c10":     {Dimension{Value: 28, Unit: Mm}, Dimension{Value: 40, Unit: Mm}},
		"c9":      {Dimension{Value: 40, Unit: Mm}, Dimension{Value: 57, Unit: Mm}},
		"c8":      {Dimension{Value: 57, Unit: Mm}, Dimension{Value: 81, Unit: Mm}},
		"c7":      {Dimension{Value: 81, Unit: Mm}, Dimension{Value: 114, Unit: Mm}},
		"c6":      {Dimension{Value: 114, Unit: Mm}, Dimension{Value: 162, Unit: Mm}},
		"c5":      {Dimension{Value: 162, Unit: Mm}, Dimension{Value: 229, Unit: Mm}},
		"c4":      {Dimension{Value: 229, Unit: Mm}, Dimension{Value: 324, Unit: Mm}},
		"c3":      {Dimension{Value: 324, Unit: Mm}, Dimension{Value: 458, Unit: Mm}},
		"c2":      {Dimension{Value: 458, Unit: Mm}, Dimension{Value: 648, Unit: Mm}},
		"c1":      {Dimension{Value: 648, Unit: Mm}, Dimension{Value: 917, Unit: Mm}},
		"c0":      {Dimension{Value: 917, Unit: Mm}, Dimension{Value: 1297, Unit: Mm}},
		"jis-b10": {Dimension{Value: 32, Unit: Mm}, Dimension{Value: 45, Unit: Mm}},
		"jis-b9":  {Dimension{Value: 45, Unit: Mm}, Dimension{Value: 64, Unit: Mm}},
		"jis-b8":  {Dimension{Value: 64, Unit: Mm}, Dimension{Value: 91, Unit: Mm}},
		"jis-b7":  {Dimension{Value: 91, Unit: Mm}, Dimension{Value: 128, Unit: Mm}},
		"jis-b6":  {Dimension{Value: 128, Unit: Mm}, Dimension{Value: 182, Unit: Mm}},
		"jis-b5":  {Dimension{Value: 182, Unit: Mm}, Dimension{Value: 257, Unit: Mm}},
		"jis-b4":  {Dimension{Value: 257, Unit: Mm}, Dimension{Value: 364, Unit: Mm}},
		"jis-b3":  {Dimension{Value: 364, Unit: Mm}, Dimension{Value: 515, Unit: Mm}},
		"jis-b2":  {Dimension{Value: 515, Unit: Mm}, Dimension{Value: 728, Unit: Mm}},
		"jis-b1":  {Dimension{Value: 728, Unit: Mm}, Dimension{Value: 1030, Unit: Mm}},
		"jis-b0":  {Dimension{Value: 1030, Unit: Mm}, Dimension{Value: 1456, Unit: Mm}},
		"letter":  {Dimension{Value: 8.5, Unit: In}, Dimension{Value: 11, Unit: In}},
		"legal":   {Dimension{Value: 8.5, Unit: In}, Dimension{Value: 14, Unit: In}},
		"ledger":  {Dimension{Value: 11, Unit: In}, Dimension{Value: 17, Unit: In}},
	}

	A4 = Point{Dimension{Value: 210, Unit: Mm}, Dimension{Value: 297, Unit: Mm}}

	KnownProperties = NewSetK()

	// Do not list shorthand properties here as we handle them before inheritance.
	//
	// Values inherited but not applicable to print are not included.
	//
	// text_decoration is not a really inherited, see
	// http://www.w3.org/TR/CSS2/text.html#propdef-text-decoration
	//
	// link: click events normally bubble up to link ancestors
	// See http://lists.w3.org/Archives/Public/www-style/2012Jun/0315.html
	Inherited = NewSetK(
		PBorderCollapse,
		PBorderSpacing,
		PCaptionSide,
		PColor,
		PDirection,
		PEmptyCells,
		PFontFamily,
		PFontFeatureSettings,
		PFontKerning,
		PFontLanguageOverride,
		PFontSize,
		PFontStyle,
		PFontStretch,
		PFontVariant,
		PFontVariantAlternates,
		PFontVariantCaps,
		PFontVariantEastAsian,
		PFontVariantLigatures,
		PFontVariantNumeric,
		PFontVariantPosition,
		PFontVariationSettings,
		PFontWeight,
		PHyphens,
		PHyphenateCharacter,
		PHyphenateLimitChars,
		PHyphenateLimitZone,
		PImageRendering,
		PImageResolution,
		PLang,
		PLetterSpacing,
		PLineHeight,
		PLink,
		PListStyleImage,
		PListStylePosition,
		PListStyleType,
		POrphans,
		POverflowWrap,
		PQuotes,
		PTabSize,
		PTextAlignAll,
		PTextAlignLast,
		PTextIndent,
		PTextTransform,
		PVisibility,
		PWhiteSpace,
		PWidows,
		PWordSpacing,
		PWordBreak,
	)

	// http://www.w3.org/TR/CSS21/tables.html#model
	// See also http://lists.w3.org/Archives/Public/www-style/2012Jun/0066.html
	// Only non-inherited properties need to be included here.
	TableWrapperBoxProperties = NewSetK(
		PBottom,
		PBreakAfter,
		PBreakBefore,
		PBreakInside,
		PClear,
		PCounterIncrement,
		PCounterReset,
		PCounterSet,
		PFloat,
		PLeft,
		PMarginTop,
		PMarginBottom,
		PMarginLeft,
		PMarginRight,
		POpacity,
		POverflow,
		PPosition,
		PRight,
		PTop,
		PTransform,
		PTransformOrigin,
		PVerticalAlign,
		PZIndex,
	)

	InitialNotComputed = NewSetK(
		PDisplay,
		PColumnGap,
		PBleedTop,
		PBleedLeft,
		PBleedBottom,
		PBleedRight,
		POutlineWidth,
		POutlineColor,
		PColumnRuleWidth,
		PColumnRuleColor,
		PBorderTopWidth,
		PBorderLeftWidth,
		PBorderBottomWidth,
		PBorderRightWidth,
		PBorderTopColor,
		PBorderLeftColor,
		PBorderBottomColor,
		PBorderRightColor,
	)
)
View Source
var Inf = Float(math.Inf(+1))
View Source
var InitialValues = Properties{}/* 177 elements not displayed */

InitialValues stores the default values for the CSS properties.

View Source
var PropsFromNames = map[string]KnownProp{}/* 177 elements not displayed */

PropsFromNames maps CSS property names to internal enum tags.

Functions

func Is

func Is(m MaybeFloat) bool

Return true except for 0 or nil

Types

type AttrData

type AttrData struct {
	Fallback   CssProperty
	Name       string
	TypeOrUnit string
}

func (AttrData) IsNone

func (v AttrData) IsNone() bool

type Bool

type Bool bool

type BoolString

type BoolString struct {
	String string
	Bool   bool
}

func (BoolString) IsNone

func (v BoolString) IsNone() bool

type Center

type Center struct {
	OriginX string
	OriginY string
	Pos     Point
}

func (Center) IsNone

func (v Center) IsNone() bool

type Centers

type Centers []Center

func (Centers) Repeat

func (bs Centers) Repeat(n int) CssProperty

type Color

type Color pa.Color

func NewColor

func NewColor(r, g, b, a Fl) Color

type ColorStop

type ColorStop struct {
	Color    Color
	Position Dimension
}

func (ColorStop) IsNone

func (v ColorStop) IsNone() bool

type ColorsStops

type ColorsStops []ColorStop

type ContentProperties

type ContentProperties []ContentProperty

type ContentProperty

type ContentProperty struct {
	// SStrings for type STRING, attr or string, counter, counters
	// Quote for type QUOTE
	// Url for URI
	// String for leader()
	Content InnerContent

	Type string
}

func (ContentProperty) AsCounter

func (c ContentProperty) AsCounter() (counterName string, counterStyle CounterStyleID)

func (ContentProperty) AsCounters

func (c ContentProperty) AsCounters() (counterName, separator string, counterStyle CounterStyleID)

func (ContentProperty) AsLeader

func (c ContentProperty) AsLeader() string

func (ContentProperty) AsQuote

func (c ContentProperty) AsQuote() Quote

func (ContentProperty) AsString

func (c ContentProperty) AsString() (value string)

func (ContentProperty) AsStrings

func (c ContentProperty) AsStrings() []string

func (ContentProperty) AsTargetCounter

func (c ContentProperty) AsTargetCounter() (anchorToken ContentProperty, counterName, counterStyle string)

func (ContentProperty) AsTargetCounters

func (c ContentProperty) AsTargetCounters() (anchorToken ContentProperty, counterName string, separator ContentProperty, counterStyle string)

func (ContentProperty) AsTargetText

func (c ContentProperty) AsTargetText() (anchorToken ContentProperty, textStyle string)

func (ContentProperty) IsNone

func (v ContentProperty) IsNone() bool

type CounterStyleID

type CounterStyleID struct {
	Type    string // one of symbols(), string, or empty for an identifier
	Name    string
	Symbols Strings
}

func (CounterStyleID) IsNone

func (v CounterStyleID) IsNone() bool

type Counters

type Counters struct {
	Name      string
	Separator string // optional, only valid for counters()
	Style     CounterStyleID
}

Counters store a counter() or counters() attribute

func (Counters) IsNone

func (v Counters) IsNone() bool

type CssProperty

type CssProperty interface {
	DeclaredValue
	// contains filtered or unexported methods
}

CssProperty is the final form of a css input, a.k.a. the computed value. Default values and "var()" have been resolved, and the raw steam ok tokens has been validated.

type DeclaredValue added in v0.0.10

type DeclaredValue interface {
	// contains filtered or unexported methods
}

DeclaredValue is the most general CSS input for a property, one of:

  • the special "initial" or "inherited" keywords.
  • a validated CssProperty
  • a raw slice of tokens (containing var() tokens), pending validation

type Decorations

type Decorations uint8

Decorations zero value means "none"

const (
	Underline Decorations = 1 << iota
	Overline
	LineThrough
	Blink
)

func (Decorations) Union added in v0.0.3

func (dec Decorations) Union(other Decorations) Decorations

Union return the union of [s] and [other]

type DefaultValue added in v0.0.10

type DefaultValue uint8
const (
	Inherit DefaultValue = iota + 1
	Initial
)

func NewDefaultValue added in v0.0.10

func NewDefaultValue(s string) DefaultValue

func (DefaultValue) String added in v0.0.10

func (d DefaultValue) String() string

type DimOrS added in v0.0.10

type DimOrS struct {
	S string
	Dimension
}

func FToPx

func FToPx(f Float) DimOrS

FToPx returns `f` as pixels.

func FToV

func FToV(f Fl) DimOrS

func MaybeFloatToValue

func MaybeFloatToValue(mf MaybeFloat) DimOrS

func PercToV added in v0.0.10

func PercToV(f Fl) DimOrS

func SToV

func SToV(s string) DimOrS

func (DimOrS) IsNone added in v0.0.10

func (v DimOrS) IsNone() bool

func (DimOrS) String added in v0.0.10

func (ds DimOrS) String() string

func (DimOrS) ToMaybeFloat added in v0.0.10

func (v DimOrS) ToMaybeFloat() MaybeFloat

type DimOrS4 added in v0.0.10

type DimOrS4 [4]DimOrS

type DimOrS5 added in v0.0.10

type DimOrS5 [5]DimOrS

type Dimension

type Dimension struct {
	Value Float
	Unit  Unit
}

Dimension without unit is interpreted as float

func FToD

func FToD(f Fl) Dimension

func NewDim added in v0.0.10

func NewDim(v Float, u Unit) Dimension

func PercToD added in v0.0.10

func PercToD(f Fl) Dimension

func (Dimension) IsNone

func (v Dimension) IsNone() bool

func (Dimension) String added in v0.0.10

func (d Dimension) String() string

func (Dimension) ToPixels

func (d Dimension) ToPixels() Dimension

func (Dimension) ToValue

func (d Dimension) ToValue() DimOrS

ToValue wraps `d` to a Value object.

type Dimensions

type Dimensions []Dimension

type DirectionType

type DirectionType struct {
	Corner string
	Angle  Fl
}

func (DirectionType) IsNone

func (v DirectionType) IsNone() bool

type Display

type Display [3]string

func (Display) Has

func (d Display) Has(v string) bool

Has returns `true` is v is one of the three elements.

type ElementStyle

type ElementStyle interface {
	StyleAccessor

	// Set is the generic method to set an arbitrary property.
	// Type accessors should be used when possible.
	Set(key PropKey, value CssProperty)

	// Get is the generic method to access an arbitrary property.
	// Type accessors should be used when possible.
	Get(key PropKey) CssProperty

	// Copy returns a deep copy of the style.
	Copy() ElementStyle

	ParentStyle() ElementStyle
	Variables() map[string]RawTokens

	Specified() SpecifiedAttributes

	Cache() TextRatioCache
}

ElementStyle defines a common interface to access style properties. Implementations will typically compute the property on the fly and cache the result.

type Fl

type Fl = utils.Fl

type Float

type Float Fl

func Abs

func Abs(x Float) Float

func Floor

func Floor(x Float) Float

func Hypot

func Hypot(a, b Float) Float

func Max

func Max(x, y Float) Float

func Maxs

func Maxs(values ...Float) Float

func MaybeFloatToFloat added in v0.0.2

func MaybeFloatToFloat(mf MaybeFloat) Float

MaybeFloatToFloat is the same as MaybeFloat.V(), but handles nil values

func Min

func Min(x, y Float) Float

func Mins

func Mins(values ...Float) Float

func (Float) ToValue

func (f Float) ToValue() DimOrS

func (Float) V

func (f Float) V() Float

type FloatString added in v0.0.3

type FloatString struct {
	String string
	Float  Fl
}

type FontFeature added in v0.0.13

type FontFeature struct {
	Tag   [4]byte
	Value uint32
}

func (FontFeature) String added in v0.0.13

func (ft FontFeature) String() string

type FontFeatures added in v0.0.13

type FontFeatures []FontFeature

An empty slice means 'normal'

type GradientSize

type GradientSize struct {
	Keyword  string
	Explicit Point
}

func (GradientSize) IsExplicit

func (s GradientSize) IsExplicit() bool

func (GradientSize) IsNone

func (v GradientSize) IsNone() bool

type GridAuto added in v0.0.10

type GridAuto []GridDims

func (GridAuto) Cycle added in v0.0.10

func (ga GridAuto) Cycle() *GridAutoIter

func (GridAuto) Reverse added in v0.0.10

func (ga GridAuto) Reverse() GridAuto

Reverse returns a new, reversed slice

type GridAutoIter added in v0.0.10

type GridAutoIter struct {
	// contains filtered or unexported fields
}

func (*GridAutoIter) Next added in v0.0.10

func (gai *GridAutoIter) Next() GridDims

type GridDims added in v0.0.10

type GridDims struct {
	V DimOrS
	// contains filtered or unexported fields
}

GridDims is a compact form for a grid template dimension. It is either :

  • a single value V
  • minmax(V, V2)
  • fit-content(V)

func NewGridDimsFitcontent added in v0.0.10

func NewGridDimsFitcontent(v Dimension) GridDims

NewGridDimsFitcontent returns fit-content(...)

func NewGridDimsMinmax added in v0.0.10

func NewGridDimsMinmax(v1, v2 DimOrS) GridDims

NewGridDimsMinmax returns minmax(...)

func NewGridDimsValue added in v0.0.10

func NewGridDimsValue(v DimOrS) GridDims

NewGridDimsValue returns a non tagged value.

func (GridDims) IsFitcontent added in v0.0.10

func (size GridDims) IsFitcontent() (v DimOrS, ok bool)

func (GridDims) IsMinmax added in v0.0.10

func (size GridDims) IsMinmax() (min, max DimOrS, ok bool)

func (GridDims) IsNone added in v0.0.10

func (v GridDims) IsNone() bool

func (GridDims) SizingFunctions added in v0.0.10

func (size GridDims) SizingFunctions() [2]DimOrS

type GridLine added in v0.0.10

type GridLine struct {
	Ident string
	Val   int
	Tag   Tag // Auto, Span or 0
}

See https://developer.mozilla.org/en-US/docs/Web/CSS/grid-row-start

func (*GridLine) IsAuto added in v0.0.10

func (gl *GridLine) IsAuto() bool

func (GridLine) IsCustomIdent added in v0.0.10

func (gl GridLine) IsCustomIdent() bool

func (*GridLine) IsSpan added in v0.0.10

func (gl *GridLine) IsSpan() bool

Span returns true for "span" attributes. In this case, the [Val] field is valid.

type GridNameRepeat added in v0.0.10

type GridNameRepeat struct {
	Names  [][]string
	Repeat int // RepeatAutoFill, >= 1 otherwise
}

type GridNames added in v0.0.10

type GridNames []string

type GridRepeat added in v0.0.10

type GridRepeat struct {
	// Every even value is a [GridNames]
	Names  []GridSpec
	Repeat int
}

type GridSpec added in v0.0.10

type GridSpec interface {
	// contains filtered or unexported methods
}

type GridTemplate added in v0.0.10

type GridTemplate struct {
	Tag Tag
	// Every even value is a [GridNames]
	Names []GridSpec
}

type GridTemplateAreas added in v0.0.10

type GridTemplateAreas [][]string

An empty list means 'none'

func (GridTemplateAreas) IsNone added in v0.0.10

func (gt GridTemplateAreas) IsNone() bool

IsNone returns true for the CSS 'none' keyword

type Image

type Image interface {
	// InnerContent
	CssProperty
	// contains filtered or unexported methods
}

Might be an existing image or a gradient

type Images

type Images []Image

func (Images) Repeat

func (bs Images) Repeat(n int) CssProperty

type InnerContent

type InnerContent interface {
	// contains filtered or unexported methods
}

guard for possible content properties

type Int

type Int int

type IntNamedString

type IntNamedString struct {
	NamedString
	Int int
}

func (IntNamedString) IsNone

func (v IntNamedString) IsNone() bool

type IntString

type IntString struct {
	String string
	Int    int
}

func (IntString) IsNone

func (v IntString) IsNone() bool

type IntStrings

type IntStrings []IntString

type JustifyOrAlign added in v0.0.13

type JustifyOrAlign [2]keywords.Keyword

JustifyOrAlign stores properties for 'justify-*' or 'align-*'

func (JustifyOrAlign) Has added in v0.0.13

func (ja JustifyOrAlign) Has(kw keywords.Keyword) bool

func (JustifyOrAlign) Intersects added in v0.0.13

func (ja JustifyOrAlign) Intersects(kws ...keywords.Keyword) bool

Intersects returns true if at least one value in [kws] is also in the list.

type KnownProp added in v0.0.5

type KnownProp uint8

KnownProp efficiently encode a known CSS property

const (

	// DO NOT CHANGE the order, because
	// the following properties are grouped by side,
	// in the [bottom, left, right, top] order,
	// so that, if side in an index (0, 1, 2 or 3),
	// the property is a PBorderBottomColor + side * 5
	PBorderBottomColor KnownProp
	PBorderBottomStyle
	PBorderBottomWidth
	PMarginBottom
	PPaddingBottom

	PBorderLeftColor
	PBorderLeftStyle
	PBorderLeftWidth
	PMarginLeft
	PPaddingLeft

	PBorderRightColor
	PBorderRightStyle
	PBorderRightWidth
	PMarginRight
	PPaddingRight

	PBorderTopColor
	PBorderTopStyle
	PBorderTopWidth
	PMarginTop
	PPaddingTop

	PBorderImageSource
	PBorderImageSlice
	PBorderImageWidth
	PBorderImageOutset
	PBorderImageRepeat

	// min-XXX is at +2, max-XXX is a + 4
	PWidth
	PHeight
	PMinWidth
	PMinHeight
	PMaxWidth
	PMaxHeight

	PColor
	PDirection
	PDisplay
	PFloat
	PLineHeight

	PPosition
	PTableLayout
	PTop
	PUnicodeBidi
	PVerticalAlign
	PVisibility
	PZIndex

	PBorderBottomLeftRadius
	PBorderBottomRightRadius
	PBorderTopLeftRadius
	PBorderTopRightRadius

	POpacity

	PColumnRuleStyle
	PColumnRuleWidth
	PColumnCount
	PColumnWidth

	PFontFamily
	PFontFeatureSettings
	PFontKerning
	PFontLanguageOverride
	PFontSize
	PFontStretch
	PFontStyle

	// The order for this group matters (see expandFontVariant)
	PFontVariantAlternates
	PFontVariantCaps
	PFontVariantEastAsian
	PFontVariantLigatures
	PFontVariantNumeric
	PFontVariantPosition

	PFontWeight
	PFontVariationSettings

	PHyphenateCharacter
	PHyphenateLimitChars
	PHyphens
	PLetterSpacing
	PTextAlignAll
	PTextAlignLast
	PTextIndent
	PTextTransform
	PWhiteSpace
	PWordBreak
	PWordSpacing
	PTransform

	PContinue
	PMaxLines
	POverflow
	POverflowWrap
	PCounterIncrement
	PCounterReset
	PCounterSet

	PAnchor
	PLink
	PLang

	PBoxDecorationBreak

	PBookmarkLabel
	PBookmarkLevel
	PBookmarkState
	PContent

	PStringSet
	PImageOrientation

	PPage
	PAppearance
	POutlineColor
	POutlineStyle
	POutlineWidth
	PBoxSizing

	// The following properties are all background related,
	// in the order expected by expandBackground
	PBackgroundColor
	PBackgroundImage
	PBackgroundRepeat
	PBackgroundAttachment
	PBackgroundPosition
	PBackgroundSize
	PBackgroundClip
	PBackgroundOrigin

	// text-decoration-XXX
	PTextDecorationLine
	PTextDecorationColor
	PTextDecorationStyle

	PBreakAfter
	PBreakBefore
	PBreakInside

	PGridAutoColumns
	PGridAutoFlow
	PGridAutoRows
	// the order matter
	PGridTemplateColumns
	PGridTemplateRows
	PGridTemplateAreas
	PGridRowStart
	PGridColumnStart
	PGridRowEnd
	PGridColumnEnd

	PAlignContent
	PAlignItems
	PAlignSelf
	PFlexBasis
	PFlexDirection
	PFlexGrow
	PFlexShrink
	PFlexWrap
	PJustifyContent
	PJustifyItems
	PJustifySelf
	POrder
	PColumnGap
	PRowGap

	PBottom
	PCaptionSide
	PClear
	PClip
	PEmptyCells
	PLeft
	PRight

	PListStyleImage
	PListStylePosition
	PListStyleType

	PTextOverflow
	PBlockEllipsis
	PBorderCollapse
	PBorderSpacing

	PTransformOrigin

	PFontVariant

	PTabSize

	PMarginBreak
	POrphans
	PWidows

	PFootnoteDisplay
	PFootnotePolicy
	PQuotes

	PImageResolution
	PImageRendering

	PColumnFill
	PColumnSpan
	PColumnRuleColor

	PSize
	PBleedLeft
	PBleedRight
	PBleedTop
	PBleedBottom
	PMarks

	PObjectFit
	PObjectPosition

	PHyphenateLimitZone

	NbProperties
)

func (KnownProp) IsTextDecoration added in v0.0.5

func (pr KnownProp) IsTextDecoration() bool

func (KnownProp) Key added in v0.0.5

func (p KnownProp) Key() PropKey

func (KnownProp) String added in v0.0.5

func (p KnownProp) String() string

type Limits added in v0.0.12

type Limits struct {
	Total, Left, Right int
}

func (Limits) IsNone added in v0.0.12

func (v Limits) IsNone() bool

type LinearGradient

type LinearGradient struct {
	ColorStops ColorsStops
	Direction  DirectionType
	Repeating  bool
}

func (LinearGradient) IsNone

func (v LinearGradient) IsNone() bool

type Marks

type Marks struct {
	Crop  bool
	Cross bool
}

func (Marks) IsNone

func (v Marks) IsNone() bool

type MaybeBool

type MaybeBool interface {
	// contains filtered or unexported methods
}

MaybeBool stores a tree state boolean : true, false or nil

type MaybeFloat

type MaybeFloat interface {
	V() Float
}

func ResolvePercentage added in v0.0.10

func ResolvePercentage(value DimOrS, referTo Float) MaybeFloat

ResolvePercentage returns the percentage of the reference value, or the value unchanged. “referTo“ is the length for 100%. If “referTo“ is not a number, it just replaces percentages.

type NamedString

type NamedString struct {
	Name   string
	String string
}

func (NamedString) IsNone

func (v NamedString) IsNone() bool

type NoneImage

type NoneImage struct{}

type OptionalRanges

type OptionalRanges struct {
	Ranges [][2]int
	Auto   bool
}

OptionalRanges is either 'auto' or a slice of ranges.

func (OptionalRanges) IsNone

func (v OptionalRanges) IsNone() bool

type Page

type Page string

type Point

type Point [2]Dimension

func (Point) IsNone

func (v Point) IsNone() bool

func (Point) ToPixels

func (p Point) ToPixels() Point

func (Point) ToSlice

func (p Point) ToSlice() []Dimension

type PropKey added in v0.0.5

type PropKey struct {
	Var string // with leading --
	KnownProp
}

PropKey stores a CSS property name, supporting variables.

func (PropKey) String added in v0.0.5

func (pr PropKey) String() string

type Properties

type Properties map[KnownProp]CssProperty

Properties is a general container for computed properties.

In addition to the generic acces, an attempt to provide a "type safe" way is provided through the GetXXX and SetXXX methods. It relies on the convention than all the keys should be present, and values never be nil. Empty values are then encoded by the zero value of the concrete type.

func (Properties) Copy

func (p Properties) Copy() Properties

Copy return a shallow copy.

func (Properties) GetAlignContent

func (s Properties) GetAlignContent() JustifyOrAlign

func (Properties) GetAlignItems

func (s Properties) GetAlignItems() JustifyOrAlign

func (Properties) GetAlignSelf

func (s Properties) GetAlignSelf() JustifyOrAlign

func (Properties) GetAnchor

func (s Properties) GetAnchor() String

func (Properties) GetAppearance added in v0.0.3

func (s Properties) GetAppearance() String

func (Properties) GetBackgroundAttachment

func (s Properties) GetBackgroundAttachment() Strings

func (Properties) GetBackgroundClip

func (s Properties) GetBackgroundClip() Strings

func (Properties) GetBackgroundColor

func (s Properties) GetBackgroundColor() Color

func (Properties) GetBackgroundImage

func (s Properties) GetBackgroundImage() Images

func (Properties) GetBackgroundOrigin

func (s Properties) GetBackgroundOrigin() Strings

func (Properties) GetBackgroundPosition

func (s Properties) GetBackgroundPosition() Centers

func (Properties) GetBackgroundRepeat

func (s Properties) GetBackgroundRepeat() Repeats

func (Properties) GetBackgroundSize

func (s Properties) GetBackgroundSize() Sizes

func (Properties) GetBleedBottom

func (s Properties) GetBleedBottom() DimOrS

func (Properties) GetBleedLeft

func (s Properties) GetBleedLeft() DimOrS

func (Properties) GetBleedRight

func (s Properties) GetBleedRight() DimOrS

func (Properties) GetBleedTop

func (s Properties) GetBleedTop() DimOrS

func (Properties) GetBlockEllipsis

func (s Properties) GetBlockEllipsis() TaggedString

func (Properties) GetBookmarkLabel

func (s Properties) GetBookmarkLabel() ContentProperties

func (Properties) GetBookmarkLevel

func (s Properties) GetBookmarkLevel() TaggedInt

func (Properties) GetBookmarkState

func (s Properties) GetBookmarkState() String

func (Properties) GetBorderBottomColor

func (s Properties) GetBorderBottomColor() Color

func (Properties) GetBorderBottomLeftRadius

func (s Properties) GetBorderBottomLeftRadius() Point

func (Properties) GetBorderBottomRightRadius

func (s Properties) GetBorderBottomRightRadius() Point

func (Properties) GetBorderBottomStyle

func (s Properties) GetBorderBottomStyle() String

func (Properties) GetBorderBottomWidth

func (s Properties) GetBorderBottomWidth() DimOrS

func (Properties) GetBorderCollapse

func (s Properties) GetBorderCollapse() String

func (Properties) GetBorderImageOutset added in v0.0.10

func (s Properties) GetBorderImageOutset() Values

func (Properties) GetBorderImageRepeat added in v0.0.10

func (s Properties) GetBorderImageRepeat() Strings

func (Properties) GetBorderImageSlice added in v0.0.10

func (s Properties) GetBorderImageSlice() Values

func (Properties) GetBorderImageSource added in v0.0.10

func (s Properties) GetBorderImageSource() Image

func (Properties) GetBorderImageWidth added in v0.0.10

func (s Properties) GetBorderImageWidth() Values

func (Properties) GetBorderLeftColor

func (s Properties) GetBorderLeftColor() Color

func (Properties) GetBorderLeftStyle

func (s Properties) GetBorderLeftStyle() String

func (Properties) GetBorderLeftWidth

func (s Properties) GetBorderLeftWidth() DimOrS

func (Properties) GetBorderRightColor

func (s Properties) GetBorderRightColor() Color

func (Properties) GetBorderRightStyle

func (s Properties) GetBorderRightStyle() String

func (Properties) GetBorderRightWidth

func (s Properties) GetBorderRightWidth() DimOrS

func (Properties) GetBorderSpacing

func (s Properties) GetBorderSpacing() Point

func (Properties) GetBorderTopColor

func (s Properties) GetBorderTopColor() Color

func (Properties) GetBorderTopLeftRadius

func (s Properties) GetBorderTopLeftRadius() Point

func (Properties) GetBorderTopRightRadius

func (s Properties) GetBorderTopRightRadius() Point

func (Properties) GetBorderTopStyle

func (s Properties) GetBorderTopStyle() String

func (Properties) GetBorderTopWidth

func (s Properties) GetBorderTopWidth() DimOrS

func (Properties) GetBottom

func (s Properties) GetBottom() DimOrS

func (Properties) GetBoxDecorationBreak

func (s Properties) GetBoxDecorationBreak() String

func (Properties) GetBoxSizing

func (s Properties) GetBoxSizing() String

func (Properties) GetBreakAfter

func (s Properties) GetBreakAfter() String

func (Properties) GetBreakBefore

func (s Properties) GetBreakBefore() String

func (Properties) GetBreakInside

func (s Properties) GetBreakInside() String

func (Properties) GetCaptionSide

func (s Properties) GetCaptionSide() String

func (Properties) GetClear

func (s Properties) GetClear() String

func (Properties) GetClip

func (s Properties) GetClip() Values

func (Properties) GetColor

func (s Properties) GetColor() Color

func (Properties) GetColumnCount

func (s Properties) GetColumnCount() IntString

func (Properties) GetColumnFill

func (s Properties) GetColumnFill() String

func (Properties) GetColumnGap

func (s Properties) GetColumnGap() DimOrS

func (Properties) GetColumnRuleColor

func (s Properties) GetColumnRuleColor() Color

func (Properties) GetColumnRuleStyle

func (s Properties) GetColumnRuleStyle() String

func (Properties) GetColumnRuleWidth

func (s Properties) GetColumnRuleWidth() DimOrS

func (Properties) GetColumnSpan

func (s Properties) GetColumnSpan() String

func (Properties) GetColumnWidth

func (s Properties) GetColumnWidth() DimOrS

func (Properties) GetContent

func (s Properties) GetContent() SContent

func (Properties) GetContinue

func (s Properties) GetContinue() String

func (Properties) GetCounterIncrement

func (s Properties) GetCounterIncrement() SIntStrings

func (Properties) GetCounterReset

func (s Properties) GetCounterReset() SIntStrings

func (Properties) GetCounterSet

func (s Properties) GetCounterSet() SIntStrings

func (Properties) GetDirection

func (s Properties) GetDirection() String

func (Properties) GetDisplay

func (s Properties) GetDisplay() Display

func (Properties) GetEmptyCells

func (s Properties) GetEmptyCells() String

func (Properties) GetFlexBasis

func (s Properties) GetFlexBasis() DimOrS

func (Properties) GetFlexDirection

func (s Properties) GetFlexDirection() String

func (Properties) GetFlexGrow

func (s Properties) GetFlexGrow() Float

func (Properties) GetFlexShrink

func (s Properties) GetFlexShrink() Float

func (Properties) GetFlexWrap

func (s Properties) GetFlexWrap() String

func (Properties) GetFloat

func (s Properties) GetFloat() String

func (Properties) GetFontFamily

func (s Properties) GetFontFamily() Strings

func (Properties) GetFontFeatureSettings

func (s Properties) GetFontFeatureSettings() FontFeatures

func (Properties) GetFontKerning

func (s Properties) GetFontKerning() String

func (Properties) GetFontLanguageOverride

func (s Properties) GetFontLanguageOverride() String

func (Properties) GetFontSize

func (s Properties) GetFontSize() DimOrS

func (Properties) GetFontStretch

func (s Properties) GetFontStretch() String

func (Properties) GetFontStyle

func (s Properties) GetFontStyle() String

func (Properties) GetFontVariant

func (s Properties) GetFontVariant() String

func (Properties) GetFontVariantAlternates

func (s Properties) GetFontVariantAlternates() String

func (Properties) GetFontVariantCaps

func (s Properties) GetFontVariantCaps() String

func (Properties) GetFontVariantEastAsian

func (s Properties) GetFontVariantEastAsian() SStrings

func (Properties) GetFontVariantLigatures

func (s Properties) GetFontVariantLigatures() SStrings

func (Properties) GetFontVariantNumeric

func (s Properties) GetFontVariantNumeric() SStrings

func (Properties) GetFontVariantPosition

func (s Properties) GetFontVariantPosition() String

func (Properties) GetFontVariationSettings added in v0.0.3

func (s Properties) GetFontVariationSettings() SFloatStrings

func (Properties) GetFontWeight

func (s Properties) GetFontWeight() IntString

func (Properties) GetFootnoteDisplay added in v0.0.2

func (s Properties) GetFootnoteDisplay() String

func (Properties) GetFootnotePolicy added in v0.0.2

func (s Properties) GetFootnotePolicy() String

func (Properties) GetGridAutoColumns added in v0.0.10

func (s Properties) GetGridAutoColumns() GridAuto

func (Properties) GetGridAutoFlow added in v0.0.10

func (s Properties) GetGridAutoFlow() Strings

func (Properties) GetGridAutoRows added in v0.0.10

func (s Properties) GetGridAutoRows() GridAuto

func (Properties) GetGridColumnEnd added in v0.0.10

func (s Properties) GetGridColumnEnd() GridLine

func (Properties) GetGridColumnStart added in v0.0.10

func (s Properties) GetGridColumnStart() GridLine

func (Properties) GetGridRowEnd added in v0.0.10

func (s Properties) GetGridRowEnd() GridLine

func (Properties) GetGridRowStart added in v0.0.10

func (s Properties) GetGridRowStart() GridLine

func (Properties) GetGridTemplateAreas added in v0.0.10

func (s Properties) GetGridTemplateAreas() GridTemplateAreas

func (Properties) GetGridTemplateColumns added in v0.0.10

func (s Properties) GetGridTemplateColumns() GridTemplate

func (Properties) GetGridTemplateRows added in v0.0.10

func (s Properties) GetGridTemplateRows() GridTemplate

func (Properties) GetHeight

func (s Properties) GetHeight() DimOrS

func (Properties) GetHyphenateCharacter

func (s Properties) GetHyphenateCharacter() String

func (Properties) GetHyphenateLimitChars

func (s Properties) GetHyphenateLimitChars() Limits

func (Properties) GetHyphenateLimitZone

func (s Properties) GetHyphenateLimitZone() DimOrS

func (Properties) GetHyphens

func (s Properties) GetHyphens() String

func (Properties) GetImageOrientation added in v0.0.3

func (s Properties) GetImageOrientation() SBoolFloat

func (Properties) GetImageRendering

func (s Properties) GetImageRendering() String

func (Properties) GetImageResolution

func (s Properties) GetImageResolution() DimOrS

func (Properties) GetJustifyContent

func (s Properties) GetJustifyContent() JustifyOrAlign

func (Properties) GetJustifyItems added in v0.0.10

func (s Properties) GetJustifyItems() JustifyOrAlign

func (Properties) GetJustifySelf added in v0.0.10

func (s Properties) GetJustifySelf() JustifyOrAlign

func (Properties) GetLang

func (s Properties) GetLang() TaggedString

func (Properties) GetLeft

func (s Properties) GetLeft() DimOrS

func (Properties) GetLetterSpacing

func (s Properties) GetLetterSpacing() DimOrS

func (Properties) GetLineHeight

func (s Properties) GetLineHeight() DimOrS
func (s Properties) GetLink() NamedString

func (Properties) GetListStyleImage

func (s Properties) GetListStyleImage() Image

func (Properties) GetListStylePosition

func (s Properties) GetListStylePosition() String

func (Properties) GetListStyleType

func (s Properties) GetListStyleType() CounterStyleID

func (Properties) GetMarginBottom

func (s Properties) GetMarginBottom() DimOrS

func (Properties) GetMarginBreak

func (s Properties) GetMarginBreak() String

func (Properties) GetMarginLeft

func (s Properties) GetMarginLeft() DimOrS

func (Properties) GetMarginRight

func (s Properties) GetMarginRight() DimOrS

func (Properties) GetMarginTop

func (s Properties) GetMarginTop() DimOrS

func (Properties) GetMarks

func (s Properties) GetMarks() Marks

func (Properties) GetMaxHeight

func (s Properties) GetMaxHeight() DimOrS

func (Properties) GetMaxLines

func (s Properties) GetMaxLines() TaggedInt

func (Properties) GetMaxWidth

func (s Properties) GetMaxWidth() DimOrS

func (Properties) GetMinHeight

func (s Properties) GetMinHeight() DimOrS

func (Properties) GetMinWidth

func (s Properties) GetMinWidth() DimOrS

func (Properties) GetObjectFit

func (s Properties) GetObjectFit() String

func (Properties) GetObjectPosition

func (s Properties) GetObjectPosition() Center

func (Properties) GetOpacity

func (s Properties) GetOpacity() Float

func (Properties) GetOrder

func (s Properties) GetOrder() Int

func (Properties) GetOrphans

func (s Properties) GetOrphans() Int

func (Properties) GetOutlineColor

func (s Properties) GetOutlineColor() Color

func (Properties) GetOutlineStyle

func (s Properties) GetOutlineStyle() String

func (Properties) GetOutlineWidth

func (s Properties) GetOutlineWidth() DimOrS

func (Properties) GetOverflow

func (s Properties) GetOverflow() String

func (Properties) GetOverflowWrap

func (s Properties) GetOverflowWrap() String

func (Properties) GetPaddingBottom

func (s Properties) GetPaddingBottom() DimOrS

func (Properties) GetPaddingLeft

func (s Properties) GetPaddingLeft() DimOrS

func (Properties) GetPaddingRight

func (s Properties) GetPaddingRight() DimOrS

func (Properties) GetPaddingTop

func (s Properties) GetPaddingTop() DimOrS

func (Properties) GetPage

func (s Properties) GetPage() Page

func (Properties) GetPosition

func (s Properties) GetPosition() BoolString

func (Properties) GetQuotes

func (s Properties) GetQuotes() Quotes

func (Properties) GetRight

func (s Properties) GetRight() DimOrS

func (Properties) GetRowGap added in v0.0.10

func (s Properties) GetRowGap() DimOrS

func (Properties) GetSize

func (s Properties) GetSize() Point

func (Properties) GetStringSet

func (s Properties) GetStringSet() StringSet

func (Properties) GetTabSize

func (s Properties) GetTabSize() DimOrS

func (Properties) GetTableLayout

func (s Properties) GetTableLayout() String

func (Properties) GetTextAlignAll

func (s Properties) GetTextAlignAll() String

func (Properties) GetTextAlignLast

func (s Properties) GetTextAlignLast() String

func (Properties) GetTextDecorationColor

func (s Properties) GetTextDecorationColor() Color

func (Properties) GetTextDecorationLine

func (s Properties) GetTextDecorationLine() Decorations

func (Properties) GetTextDecorationStyle

func (s Properties) GetTextDecorationStyle() String

func (Properties) GetTextIndent

func (s Properties) GetTextIndent() DimOrS

func (Properties) GetTextOverflow

func (s Properties) GetTextOverflow() String

func (Properties) GetTextTransform

func (s Properties) GetTextTransform() String

func (Properties) GetTop

func (s Properties) GetTop() DimOrS

func (Properties) GetTransform

func (s Properties) GetTransform() Transforms

func (Properties) GetTransformOrigin

func (s Properties) GetTransformOrigin() Point

func (Properties) GetUnicodeBidi

func (s Properties) GetUnicodeBidi() String

func (Properties) GetVerticalAlign

func (s Properties) GetVerticalAlign() DimOrS

func (Properties) GetVisibility

func (s Properties) GetVisibility() String

func (Properties) GetWhiteSpace

func (s Properties) GetWhiteSpace() String

func (Properties) GetWidows

func (s Properties) GetWidows() Int

func (Properties) GetWidth

func (s Properties) GetWidth() DimOrS

func (Properties) GetWordBreak added in v0.0.2

func (s Properties) GetWordBreak() String

func (Properties) GetWordSpacing

func (s Properties) GetWordSpacing() DimOrS

func (Properties) GetZIndex

func (s Properties) GetZIndex() IntString

func (Properties) SetAlignContent

func (s Properties) SetAlignContent(v JustifyOrAlign)

func (Properties) SetAlignItems

func (s Properties) SetAlignItems(v JustifyOrAlign)

func (Properties) SetAlignSelf

func (s Properties) SetAlignSelf(v JustifyOrAlign)

func (Properties) SetAnchor

func (s Properties) SetAnchor(v String)

func (Properties) SetAppearance added in v0.0.3

func (s Properties) SetAppearance(v String)

func (Properties) SetBackgroundAttachment

func (s Properties) SetBackgroundAttachment(v Strings)

func (Properties) SetBackgroundClip

func (s Properties) SetBackgroundClip(v Strings)

func (Properties) SetBackgroundColor

func (s Properties) SetBackgroundColor(v Color)

func (Properties) SetBackgroundImage

func (s Properties) SetBackgroundImage(v Images)

func (Properties) SetBackgroundOrigin

func (s Properties) SetBackgroundOrigin(v Strings)

func (Properties) SetBackgroundPosition

func (s Properties) SetBackgroundPosition(v Centers)

func (Properties) SetBackgroundRepeat

func (s Properties) SetBackgroundRepeat(v Repeats)

func (Properties) SetBackgroundSize

func (s Properties) SetBackgroundSize(v Sizes)

func (Properties) SetBleedBottom

func (s Properties) SetBleedBottom(v DimOrS)

func (Properties) SetBleedLeft

func (s Properties) SetBleedLeft(v DimOrS)

func (Properties) SetBleedRight

func (s Properties) SetBleedRight(v DimOrS)

func (Properties) SetBleedTop

func (s Properties) SetBleedTop(v DimOrS)

func (Properties) SetBlockEllipsis

func (s Properties) SetBlockEllipsis(v TaggedString)

func (Properties) SetBookmarkLabel

func (s Properties) SetBookmarkLabel(v ContentProperties)

func (Properties) SetBookmarkLevel

func (s Properties) SetBookmarkLevel(v TaggedInt)

func (Properties) SetBookmarkState

func (s Properties) SetBookmarkState(v String)

func (Properties) SetBorderBottomColor

func (s Properties) SetBorderBottomColor(v Color)

func (Properties) SetBorderBottomLeftRadius

func (s Properties) SetBorderBottomLeftRadius(v Point)

func (Properties) SetBorderBottomRightRadius

func (s Properties) SetBorderBottomRightRadius(v Point)

func (Properties) SetBorderBottomStyle

func (s Properties) SetBorderBottomStyle(v String)

func (Properties) SetBorderBottomWidth

func (s Properties) SetBorderBottomWidth(v DimOrS)

func (Properties) SetBorderCollapse

func (s Properties) SetBorderCollapse(v String)

func (Properties) SetBorderImageOutset added in v0.0.10

func (s Properties) SetBorderImageOutset(v Values)

func (Properties) SetBorderImageRepeat added in v0.0.10

func (s Properties) SetBorderImageRepeat(v Strings)

func (Properties) SetBorderImageSlice added in v0.0.10

func (s Properties) SetBorderImageSlice(v Values)

func (Properties) SetBorderImageSource added in v0.0.10

func (s Properties) SetBorderImageSource(v Image)

func (Properties) SetBorderImageWidth added in v0.0.10

func (s Properties) SetBorderImageWidth(v Values)

func (Properties) SetBorderLeftColor

func (s Properties) SetBorderLeftColor(v Color)

func (Properties) SetBorderLeftStyle

func (s Properties) SetBorderLeftStyle(v String)

func (Properties) SetBorderLeftWidth

func (s Properties) SetBorderLeftWidth(v DimOrS)

func (Properties) SetBorderRightColor

func (s Properties) SetBorderRightColor(v Color)

func (Properties) SetBorderRightStyle

func (s Properties) SetBorderRightStyle(v String)

func (Properties) SetBorderRightWidth

func (s Properties) SetBorderRightWidth(v DimOrS)

func (Properties) SetBorderSpacing

func (s Properties) SetBorderSpacing(v Point)

func (Properties) SetBorderTopColor

func (s Properties) SetBorderTopColor(v Color)

func (Properties) SetBorderTopLeftRadius

func (s Properties) SetBorderTopLeftRadius(v Point)

func (Properties) SetBorderTopRightRadius

func (s Properties) SetBorderTopRightRadius(v Point)

func (Properties) SetBorderTopStyle

func (s Properties) SetBorderTopStyle(v String)

func (Properties) SetBorderTopWidth

func (s Properties) SetBorderTopWidth(v DimOrS)

func (Properties) SetBottom

func (s Properties) SetBottom(v DimOrS)

func (Properties) SetBoxDecorationBreak

func (s Properties) SetBoxDecorationBreak(v String)

func (Properties) SetBoxSizing

func (s Properties) SetBoxSizing(v String)

func (Properties) SetBreakAfter

func (s Properties) SetBreakAfter(v String)

func (Properties) SetBreakBefore

func (s Properties) SetBreakBefore(v String)

func (Properties) SetBreakInside

func (s Properties) SetBreakInside(v String)

func (Properties) SetCaptionSide

func (s Properties) SetCaptionSide(v String)

func (Properties) SetClear

func (s Properties) SetClear(v String)

func (Properties) SetClip

func (s Properties) SetClip(v Values)

func (Properties) SetColor

func (s Properties) SetColor(v Color)

func (Properties) SetColumnCount

func (s Properties) SetColumnCount(v IntString)

func (Properties) SetColumnFill

func (s Properties) SetColumnFill(v String)

func (Properties) SetColumnGap

func (s Properties) SetColumnGap(v DimOrS)

func (Properties) SetColumnRuleColor

func (s Properties) SetColumnRuleColor(v Color)

func (Properties) SetColumnRuleStyle

func (s Properties) SetColumnRuleStyle(v String)

func (Properties) SetColumnRuleWidth

func (s Properties) SetColumnRuleWidth(v DimOrS)

func (Properties) SetColumnSpan

func (s Properties) SetColumnSpan(v String)

func (Properties) SetColumnWidth

func (s Properties) SetColumnWidth(v DimOrS)

func (Properties) SetContent

func (s Properties) SetContent(v SContent)

func (Properties) SetContinue

func (s Properties) SetContinue(v String)

func (Properties) SetCounterIncrement

func (s Properties) SetCounterIncrement(v SIntStrings)

func (Properties) SetCounterReset

func (s Properties) SetCounterReset(v SIntStrings)

func (Properties) SetCounterSet

func (s Properties) SetCounterSet(v SIntStrings)

func (Properties) SetDirection

func (s Properties) SetDirection(v String)

func (Properties) SetDisplay

func (s Properties) SetDisplay(v Display)

func (Properties) SetEmptyCells

func (s Properties) SetEmptyCells(v String)

func (Properties) SetFlexBasis

func (s Properties) SetFlexBasis(v DimOrS)

func (Properties) SetFlexDirection

func (s Properties) SetFlexDirection(v String)

func (Properties) SetFlexGrow

func (s Properties) SetFlexGrow(v Float)

func (Properties) SetFlexShrink

func (s Properties) SetFlexShrink(v Float)

func (Properties) SetFlexWrap

func (s Properties) SetFlexWrap(v String)

func (Properties) SetFloat

func (s Properties) SetFloat(v String)

func (Properties) SetFontFamily

func (s Properties) SetFontFamily(v Strings)

func (Properties) SetFontFeatureSettings

func (s Properties) SetFontFeatureSettings(v FontFeatures)

func (Properties) SetFontKerning

func (s Properties) SetFontKerning(v String)

func (Properties) SetFontLanguageOverride

func (s Properties) SetFontLanguageOverride(v String)

func (Properties) SetFontSize

func (s Properties) SetFontSize(v DimOrS)

func (Properties) SetFontStretch

func (s Properties) SetFontStretch(v String)

func (Properties) SetFontStyle

func (s Properties) SetFontStyle(v String)

func (Properties) SetFontVariant

func (s Properties) SetFontVariant(v String)

func (Properties) SetFontVariantAlternates

func (s Properties) SetFontVariantAlternates(v String)

func (Properties) SetFontVariantCaps

func (s Properties) SetFontVariantCaps(v String)

func (Properties) SetFontVariantEastAsian

func (s Properties) SetFontVariantEastAsian(v SStrings)

func (Properties) SetFontVariantLigatures

func (s Properties) SetFontVariantLigatures(v SStrings)

func (Properties) SetFontVariantNumeric

func (s Properties) SetFontVariantNumeric(v SStrings)

func (Properties) SetFontVariantPosition

func (s Properties) SetFontVariantPosition(v String)

func (Properties) SetFontVariationSettings added in v0.0.3

func (s Properties) SetFontVariationSettings(v SFloatStrings)

func (Properties) SetFontWeight

func (s Properties) SetFontWeight(v IntString)

func (Properties) SetFootnoteDisplay added in v0.0.2

func (s Properties) SetFootnoteDisplay(v String)

func (Properties) SetFootnotePolicy added in v0.0.2

func (s Properties) SetFootnotePolicy(v String)

func (Properties) SetGridAutoColumns added in v0.0.10

func (s Properties) SetGridAutoColumns(v GridAuto)

func (Properties) SetGridAutoFlow added in v0.0.10

func (s Properties) SetGridAutoFlow(v Strings)

func (Properties) SetGridAutoRows added in v0.0.10

func (s Properties) SetGridAutoRows(v GridAuto)

func (Properties) SetGridColumnEnd added in v0.0.10

func (s Properties) SetGridColumnEnd(v GridLine)

func (Properties) SetGridColumnStart added in v0.0.10

func (s Properties) SetGridColumnStart(v GridLine)

func (Properties) SetGridRowEnd added in v0.0.10

func (s Properties) SetGridRowEnd(v GridLine)

func (Properties) SetGridRowStart added in v0.0.10

func (s Properties) SetGridRowStart(v GridLine)

func (Properties) SetGridTemplateAreas added in v0.0.10

func (s Properties) SetGridTemplateAreas(v GridTemplateAreas)

func (Properties) SetGridTemplateColumns added in v0.0.10

func (s Properties) SetGridTemplateColumns(v GridTemplate)

func (Properties) SetGridTemplateRows added in v0.0.10

func (s Properties) SetGridTemplateRows(v GridTemplate)

func (Properties) SetHeight

func (s Properties) SetHeight(v DimOrS)

func (Properties) SetHyphenateCharacter

func (s Properties) SetHyphenateCharacter(v String)

func (Properties) SetHyphenateLimitChars

func (s Properties) SetHyphenateLimitChars(v Limits)

func (Properties) SetHyphenateLimitZone

func (s Properties) SetHyphenateLimitZone(v DimOrS)

func (Properties) SetHyphens

func (s Properties) SetHyphens(v String)

func (Properties) SetImageOrientation added in v0.0.3

func (s Properties) SetImageOrientation(v SBoolFloat)

func (Properties) SetImageRendering

func (s Properties) SetImageRendering(v String)

func (Properties) SetImageResolution

func (s Properties) SetImageResolution(v DimOrS)

func (Properties) SetJustifyContent

func (s Properties) SetJustifyContent(v JustifyOrAlign)

func (Properties) SetJustifyItems added in v0.0.10

func (s Properties) SetJustifyItems(v JustifyOrAlign)

func (Properties) SetJustifySelf added in v0.0.10

func (s Properties) SetJustifySelf(v JustifyOrAlign)

func (Properties) SetLang

func (s Properties) SetLang(v TaggedString)

func (Properties) SetLeft

func (s Properties) SetLeft(v DimOrS)

func (Properties) SetLetterSpacing

func (s Properties) SetLetterSpacing(v DimOrS)

func (Properties) SetLineHeight

func (s Properties) SetLineHeight(v DimOrS)
func (s Properties) SetLink(v NamedString)

func (Properties) SetListStyleImage

func (s Properties) SetListStyleImage(v Image)

func (Properties) SetListStylePosition

func (s Properties) SetListStylePosition(v String)

func (Properties) SetListStyleType

func (s Properties) SetListStyleType(v CounterStyleID)

func (Properties) SetMarginBottom

func (s Properties) SetMarginBottom(v DimOrS)

func (Properties) SetMarginBreak

func (s Properties) SetMarginBreak(v String)

func (Properties) SetMarginLeft

func (s Properties) SetMarginLeft(v DimOrS)

func (Properties) SetMarginRight

func (s Properties) SetMarginRight(v DimOrS)

func (Properties) SetMarginTop

func (s Properties) SetMarginTop(v DimOrS)

func (Properties) SetMarks

func (s Properties) SetMarks(v Marks)

func (Properties) SetMaxHeight

func (s Properties) SetMaxHeight(v DimOrS)

func (Properties) SetMaxLines

func (s Properties) SetMaxLines(v TaggedInt)

func (Properties) SetMaxWidth

func (s Properties) SetMaxWidth(v DimOrS)

func (Properties) SetMinHeight

func (s Properties) SetMinHeight(v DimOrS)

func (Properties) SetMinWidth

func (s Properties) SetMinWidth(v DimOrS)

func (Properties) SetObjectFit

func (s Properties) SetObjectFit(v String)

func (Properties) SetObjectPosition

func (s Properties) SetObjectPosition(v Center)

func (Properties) SetOpacity

func (s Properties) SetOpacity(v Float)

func (Properties) SetOrder

func (s Properties) SetOrder(v Int)

func (Properties) SetOrphans

func (s Properties) SetOrphans(v Int)

func (Properties) SetOutlineColor

func (s Properties) SetOutlineColor(v Color)

func (Properties) SetOutlineStyle

func (s Properties) SetOutlineStyle(v String)

func (Properties) SetOutlineWidth

func (s Properties) SetOutlineWidth(v DimOrS)

func (Properties) SetOverflow

func (s Properties) SetOverflow(v String)

func (Properties) SetOverflowWrap

func (s Properties) SetOverflowWrap(v String)

func (Properties) SetPaddingBottom

func (s Properties) SetPaddingBottom(v DimOrS)

func (Properties) SetPaddingLeft

func (s Properties) SetPaddingLeft(v DimOrS)

func (Properties) SetPaddingRight

func (s Properties) SetPaddingRight(v DimOrS)

func (Properties) SetPaddingTop

func (s Properties) SetPaddingTop(v DimOrS)

func (Properties) SetPage

func (s Properties) SetPage(v Page)

func (Properties) SetPosition

func (s Properties) SetPosition(v BoolString)

func (Properties) SetQuotes

func (s Properties) SetQuotes(v Quotes)

func (Properties) SetRight

func (s Properties) SetRight(v DimOrS)

func (Properties) SetRowGap added in v0.0.10

func (s Properties) SetRowGap(v DimOrS)

func (Properties) SetSize

func (s Properties) SetSize(v Point)

func (Properties) SetStringSet

func (s Properties) SetStringSet(v StringSet)

func (Properties) SetTabSize

func (s Properties) SetTabSize(v DimOrS)

func (Properties) SetTableLayout

func (s Properties) SetTableLayout(v String)

func (Properties) SetTextAlignAll

func (s Properties) SetTextAlignAll(v String)

func (Properties) SetTextAlignLast

func (s Properties) SetTextAlignLast(v String)

func (Properties) SetTextDecorationColor

func (s Properties) SetTextDecorationColor(v Color)

func (Properties) SetTextDecorationLine

func (s Properties) SetTextDecorationLine(v Decorations)

func (Properties) SetTextDecorationStyle

func (s Properties) SetTextDecorationStyle(v String)

func (Properties) SetTextIndent

func (s Properties) SetTextIndent(v DimOrS)

func (Properties) SetTextOverflow

func (s Properties) SetTextOverflow(v String)

func (Properties) SetTextTransform

func (s Properties) SetTextTransform(v String)

func (Properties) SetTop

func (s Properties) SetTop(v DimOrS)

func (Properties) SetTransform

func (s Properties) SetTransform(v Transforms)

func (Properties) SetTransformOrigin

func (s Properties) SetTransformOrigin(v Point)

func (Properties) SetUnicodeBidi

func (s Properties) SetUnicodeBidi(v String)

func (Properties) SetVerticalAlign

func (s Properties) SetVerticalAlign(v DimOrS)

func (Properties) SetVisibility

func (s Properties) SetVisibility(v String)

func (Properties) SetWhiteSpace

func (s Properties) SetWhiteSpace(v String)

func (Properties) SetWidows

func (s Properties) SetWidows(v Int)

func (Properties) SetWidth

func (s Properties) SetWidth(v DimOrS)

func (Properties) SetWordBreak added in v0.0.2

func (s Properties) SetWordBreak(v String)

func (Properties) SetWordSpacing

func (s Properties) SetWordSpacing(v DimOrS)

func (Properties) SetZIndex

func (s Properties) SetZIndex(v IntString)

func (Properties) UpdateWith

func (p Properties) UpdateWith(other Properties)

UpdateWith merge the entries from `other` to `p`.

type Quote

type Quote struct {
	Open   bool
	Insert bool
}

func (Quote) IsNone

func (v Quote) IsNone() bool

type Quotes

type Quotes struct {
	Open  Strings
	Close Strings
	Tag   Tag
}

func (Quotes) IsNone

func (v Quotes) IsNone() bool

type RadialGradient

type RadialGradient struct {
	ColorStops ColorsStops
	Shape      string
	Size       GradientSize
	Center     Center
	Repeating  bool
}

func (RadialGradient) IsNone

func (v RadialGradient) IsNone() bool

type RawTokens

type RawTokens []parser.Token

func (RawTokens) String added in v0.0.10

func (rt RawTokens) String() string

type Rectangle

type Rectangle [4]Float

func (Rectangle) IsNone

func (r Rectangle) IsNone() bool

func (Rectangle) ToFloat

func (r Rectangle) ToFloat() [4]Fl

func (Rectangle) Unpack

func (r Rectangle) Unpack() (x, y, w, h Fl)

func (Rectangle) Unpack2

func (r Rectangle) Unpack2() (x, y, w, h Float)

type Repeats

type Repeats [][2]string

func (Repeats) Repeat

func (bs Repeats) Repeat(n int) CssProperty

type SBoolFloat added in v0.0.3

type SBoolFloat struct {
	String string
	Bool   bool
	Float  Fl
}

type SContent

type SContent struct {
	String   string
	Contents ContentProperties
}

func (SContent) IsNone

func (v SContent) IsNone() bool

type SContentProp

type SContentProp struct {
	ContentProperty ContentProperty
	String          string
}

func (SContentProp) IsNone

func (v SContentProp) IsNone() bool

type SContentProps

type SContentProps []SContentProp

type SContents

type SContents []SContent

type SDimensions

type SDimensions struct {
	String     string
	Dimensions Dimensions
}

func (SDimensions) IsNone

func (v SDimensions) IsNone() bool

type SFloatStrings added in v0.0.3

type SFloatStrings struct {
	String string
	Values []FloatString
}

SFloatStrings is either a string or a list of (string, float) pairs

type SIntStrings

type SIntStrings struct {
	String string
	Values IntStrings
}

func (SIntStrings) IsNone

func (v SIntStrings) IsNone() bool

type SStrings

type SStrings struct {
	String  string
	Strings Strings
}

func (SStrings) IsNone

func (v SStrings) IsNone() bool

type SetK added in v0.0.5

type SetK map[KnownProp]struct{}

func NewSetK added in v0.0.5

func NewSetK(values ...KnownProp) SetK

func (SetK) Add added in v0.0.5

func (s SetK) Add(key KnownProp)

func (SetK) Copy added in v0.0.5

func (s SetK) Copy() SetK

Copy returns a deepcopy.

func (SetK) Equal added in v0.0.5

func (s SetK) Equal(other SetK) bool

func (SetK) Extend added in v0.0.5

func (s SetK) Extend(keys []KnownProp)

func (SetK) Has added in v0.0.5

func (s SetK) Has(key KnownProp) bool

func (SetK) IsNone added in v0.0.5

func (s SetK) IsNone() bool

type Shortand added in v0.0.10

type Shortand uint8

Shortand is a compact representation of CSS keywords used as shortand for several properties

const (
	SBorderColor Shortand
	SBorderStyle
	SBorderWidth
	SBorderImage
	SMargin
	SPadding
	SBleed
	SBorderRadius
	SPageBreakAfter
	SPageBreakBefore
	SPageBreakInside
	SBackground
	SWordWrap
	SListStyle
	SBorder
	SBorderTop
	SBorderRight
	SBorderBottom
	SBorderLeft
	SColumnRule
	SOutline
	SColumns
	SFontVariant
	SFont
	STextDecoration
	SFlex
	SFlexFlow
	SLineClamp
	STextAlign
	SGridColumn
	SGridRow
	SGridArea
	SGridTemplate
	SGrid
)

func NewShortand added in v0.0.10

func NewShortand(s string) Shortand

NewShortand return the tag for 's' or 0 if not supported

func (Shortand) String added in v0.0.10

func (sh Shortand) String() string

String returns the CSS keyword.

type Size

type Size struct {
	String string
	Width  DimOrS
	Height DimOrS
}

Dimension or "auto" or "cover" or "contain"

func (Size) IsNone

func (v Size) IsNone() bool

type Sizes

type Sizes []Size

func (Sizes) Repeat

func (bs Sizes) Repeat(n int) CssProperty

type SpecifiedAttributes

type SpecifiedAttributes struct {
	Float    String
	Display  Display
	Position BoolString
}

SpecifiedAttributes stores the value of CSS properties as specified.

type String

type String string

type StringSet

type StringSet struct {
	String   string
	Contents SContents
}

func (StringSet) IsNone

func (v StringSet) IsNone() bool

type Strings

type Strings []string

func (Strings) Intersects added in v0.0.10

func (ss Strings) Intersects(values ...string) bool

Intersects returns true if at least one value in [values] is also in the list.

func (Strings) Repeat

func (bs Strings) Repeat(n int) CssProperty

type StyleAccessor

type StyleAccessor interface {
	GetAlignContent() JustifyOrAlign
	SetAlignContent(v JustifyOrAlign)

	GetAlignItems() JustifyOrAlign
	SetAlignItems(v JustifyOrAlign)

	GetAlignSelf() JustifyOrAlign
	SetAlignSelf(v JustifyOrAlign)

	GetAnchor() String
	SetAnchor(v String)

	GetAppearance() String
	SetAppearance(v String)

	GetBackgroundAttachment() Strings
	SetBackgroundAttachment(v Strings)

	GetBackgroundClip() Strings
	SetBackgroundClip(v Strings)

	GetBackgroundColor() Color
	SetBackgroundColor(v Color)

	GetBackgroundImage() Images
	SetBackgroundImage(v Images)

	GetBackgroundOrigin() Strings
	SetBackgroundOrigin(v Strings)

	GetBackgroundPosition() Centers
	SetBackgroundPosition(v Centers)

	GetBackgroundRepeat() Repeats
	SetBackgroundRepeat(v Repeats)

	GetBackgroundSize() Sizes
	SetBackgroundSize(v Sizes)

	GetBleedBottom() DimOrS
	SetBleedBottom(v DimOrS)

	GetBleedLeft() DimOrS
	SetBleedLeft(v DimOrS)

	GetBleedRight() DimOrS
	SetBleedRight(v DimOrS)

	GetBleedTop() DimOrS
	SetBleedTop(v DimOrS)

	GetBlockEllipsis() TaggedString
	SetBlockEllipsis(v TaggedString)

	GetBookmarkLabel() ContentProperties
	SetBookmarkLabel(v ContentProperties)

	GetBookmarkLevel() TaggedInt
	SetBookmarkLevel(v TaggedInt)

	GetBookmarkState() String
	SetBookmarkState(v String)

	GetBorderBottomColor() Color
	SetBorderBottomColor(v Color)

	GetBorderBottomLeftRadius() Point
	SetBorderBottomLeftRadius(v Point)

	GetBorderBottomRightRadius() Point
	SetBorderBottomRightRadius(v Point)

	GetBorderBottomStyle() String
	SetBorderBottomStyle(v String)

	GetBorderBottomWidth() DimOrS
	SetBorderBottomWidth(v DimOrS)

	GetBorderCollapse() String
	SetBorderCollapse(v String)

	GetBorderImageOutset() Values
	SetBorderImageOutset(v Values)

	GetBorderImageRepeat() Strings
	SetBorderImageRepeat(v Strings)

	GetBorderImageSlice() Values
	SetBorderImageSlice(v Values)

	GetBorderImageSource() Image
	SetBorderImageSource(v Image)

	GetBorderImageWidth() Values
	SetBorderImageWidth(v Values)

	GetBorderLeftColor() Color
	SetBorderLeftColor(v Color)

	GetBorderLeftStyle() String
	SetBorderLeftStyle(v String)

	GetBorderLeftWidth() DimOrS
	SetBorderLeftWidth(v DimOrS)

	GetBorderRightColor() Color
	SetBorderRightColor(v Color)

	GetBorderRightStyle() String
	SetBorderRightStyle(v String)

	GetBorderRightWidth() DimOrS
	SetBorderRightWidth(v DimOrS)

	GetBorderSpacing() Point
	SetBorderSpacing(v Point)

	GetBorderTopColor() Color
	SetBorderTopColor(v Color)

	GetBorderTopLeftRadius() Point
	SetBorderTopLeftRadius(v Point)

	GetBorderTopRightRadius() Point
	SetBorderTopRightRadius(v Point)

	GetBorderTopStyle() String
	SetBorderTopStyle(v String)

	GetBorderTopWidth() DimOrS
	SetBorderTopWidth(v DimOrS)

	GetBottom() DimOrS
	SetBottom(v DimOrS)

	GetBoxDecorationBreak() String
	SetBoxDecorationBreak(v String)

	GetBoxSizing() String
	SetBoxSizing(v String)

	GetBreakAfter() String
	SetBreakAfter(v String)

	GetBreakBefore() String
	SetBreakBefore(v String)

	GetBreakInside() String
	SetBreakInside(v String)

	GetCaptionSide() String
	SetCaptionSide(v String)

	GetClear() String
	SetClear(v String)

	GetClip() Values
	SetClip(v Values)

	GetColor() Color
	SetColor(v Color)

	GetColumnCount() IntString
	SetColumnCount(v IntString)

	GetColumnFill() String
	SetColumnFill(v String)

	GetColumnGap() DimOrS
	SetColumnGap(v DimOrS)

	GetColumnRuleColor() Color
	SetColumnRuleColor(v Color)

	GetColumnRuleStyle() String
	SetColumnRuleStyle(v String)

	GetColumnRuleWidth() DimOrS
	SetColumnRuleWidth(v DimOrS)

	GetColumnSpan() String
	SetColumnSpan(v String)

	GetColumnWidth() DimOrS
	SetColumnWidth(v DimOrS)

	GetContent() SContent
	SetContent(v SContent)

	GetContinue() String
	SetContinue(v String)

	GetCounterIncrement() SIntStrings
	SetCounterIncrement(v SIntStrings)

	GetCounterReset() SIntStrings
	SetCounterReset(v SIntStrings)

	GetCounterSet() SIntStrings
	SetCounterSet(v SIntStrings)

	GetDirection() String
	SetDirection(v String)

	GetDisplay() Display
	SetDisplay(v Display)

	GetEmptyCells() String
	SetEmptyCells(v String)

	GetFlexBasis() DimOrS
	SetFlexBasis(v DimOrS)

	GetFlexDirection() String
	SetFlexDirection(v String)

	GetFlexGrow() Float
	SetFlexGrow(v Float)

	GetFlexShrink() Float
	SetFlexShrink(v Float)

	GetFlexWrap() String
	SetFlexWrap(v String)

	GetFloat() String
	SetFloat(v String)

	GetFontFamily() Strings
	SetFontFamily(v Strings)

	GetFontFeatureSettings() FontFeatures
	SetFontFeatureSettings(v FontFeatures)

	GetFontKerning() String
	SetFontKerning(v String)

	GetFontLanguageOverride() String
	SetFontLanguageOverride(v String)

	GetFontSize() DimOrS
	SetFontSize(v DimOrS)

	GetFontStretch() String
	SetFontStretch(v String)

	GetFontStyle() String
	SetFontStyle(v String)

	GetFontVariant() String
	SetFontVariant(v String)

	GetFontVariantAlternates() String
	SetFontVariantAlternates(v String)

	GetFontVariantCaps() String
	SetFontVariantCaps(v String)

	GetFontVariantEastAsian() SStrings
	SetFontVariantEastAsian(v SStrings)

	GetFontVariantLigatures() SStrings
	SetFontVariantLigatures(v SStrings)

	GetFontVariantNumeric() SStrings
	SetFontVariantNumeric(v SStrings)

	GetFontVariantPosition() String
	SetFontVariantPosition(v String)

	GetFontVariationSettings() SFloatStrings
	SetFontVariationSettings(v SFloatStrings)

	GetFontWeight() IntString
	SetFontWeight(v IntString)

	GetFootnoteDisplay() String
	SetFootnoteDisplay(v String)

	GetFootnotePolicy() String
	SetFootnotePolicy(v String)

	GetGridAutoColumns() GridAuto
	SetGridAutoColumns(v GridAuto)

	GetGridAutoFlow() Strings
	SetGridAutoFlow(v Strings)

	GetGridAutoRows() GridAuto
	SetGridAutoRows(v GridAuto)

	GetGridColumnEnd() GridLine
	SetGridColumnEnd(v GridLine)

	GetGridColumnStart() GridLine
	SetGridColumnStart(v GridLine)

	GetGridRowEnd() GridLine
	SetGridRowEnd(v GridLine)

	GetGridRowStart() GridLine
	SetGridRowStart(v GridLine)

	GetGridTemplateAreas() GridTemplateAreas
	SetGridTemplateAreas(v GridTemplateAreas)

	GetGridTemplateColumns() GridTemplate
	SetGridTemplateColumns(v GridTemplate)

	GetGridTemplateRows() GridTemplate
	SetGridTemplateRows(v GridTemplate)

	GetHeight() DimOrS
	SetHeight(v DimOrS)

	GetHyphenateCharacter() String
	SetHyphenateCharacter(v String)

	GetHyphenateLimitChars() Limits
	SetHyphenateLimitChars(v Limits)

	GetHyphenateLimitZone() DimOrS
	SetHyphenateLimitZone(v DimOrS)

	GetHyphens() String
	SetHyphens(v String)

	GetImageOrientation() SBoolFloat
	SetImageOrientation(v SBoolFloat)

	GetImageRendering() String
	SetImageRendering(v String)

	GetImageResolution() DimOrS
	SetImageResolution(v DimOrS)

	GetJustifyContent() JustifyOrAlign
	SetJustifyContent(v JustifyOrAlign)

	GetJustifyItems() JustifyOrAlign
	SetJustifyItems(v JustifyOrAlign)

	GetJustifySelf() JustifyOrAlign
	SetJustifySelf(v JustifyOrAlign)

	GetLang() TaggedString
	SetLang(v TaggedString)

	GetLeft() DimOrS
	SetLeft(v DimOrS)

	GetLetterSpacing() DimOrS
	SetLetterSpacing(v DimOrS)

	GetLineHeight() DimOrS
	SetLineHeight(v DimOrS)

	GetLink() NamedString
	SetLink(v NamedString)

	GetListStyleImage() Image
	SetListStyleImage(v Image)

	GetListStylePosition() String
	SetListStylePosition(v String)

	GetListStyleType() CounterStyleID
	SetListStyleType(v CounterStyleID)

	GetMarginBottom() DimOrS
	SetMarginBottom(v DimOrS)

	GetMarginBreak() String
	SetMarginBreak(v String)

	GetMarginLeft() DimOrS
	SetMarginLeft(v DimOrS)

	GetMarginRight() DimOrS
	SetMarginRight(v DimOrS)

	GetMarginTop() DimOrS
	SetMarginTop(v DimOrS)

	GetMarks() Marks
	SetMarks(v Marks)

	GetMaxHeight() DimOrS
	SetMaxHeight(v DimOrS)

	GetMaxLines() TaggedInt
	SetMaxLines(v TaggedInt)

	GetMaxWidth() DimOrS
	SetMaxWidth(v DimOrS)

	GetMinHeight() DimOrS
	SetMinHeight(v DimOrS)

	GetMinWidth() DimOrS
	SetMinWidth(v DimOrS)

	GetObjectFit() String
	SetObjectFit(v String)

	GetObjectPosition() Center
	SetObjectPosition(v Center)

	GetOpacity() Float
	SetOpacity(v Float)

	GetOrder() Int
	SetOrder(v Int)

	GetOrphans() Int
	SetOrphans(v Int)

	GetOutlineColor() Color
	SetOutlineColor(v Color)

	GetOutlineStyle() String
	SetOutlineStyle(v String)

	GetOutlineWidth() DimOrS
	SetOutlineWidth(v DimOrS)

	GetOverflow() String
	SetOverflow(v String)

	GetOverflowWrap() String
	SetOverflowWrap(v String)

	GetPaddingBottom() DimOrS
	SetPaddingBottom(v DimOrS)

	GetPaddingLeft() DimOrS
	SetPaddingLeft(v DimOrS)

	GetPaddingRight() DimOrS
	SetPaddingRight(v DimOrS)

	GetPaddingTop() DimOrS
	SetPaddingTop(v DimOrS)

	GetPage() Page
	SetPage(v Page)

	GetPosition() BoolString
	SetPosition(v BoolString)

	GetQuotes() Quotes
	SetQuotes(v Quotes)

	GetRight() DimOrS
	SetRight(v DimOrS)

	GetRowGap() DimOrS
	SetRowGap(v DimOrS)

	GetSize() Point
	SetSize(v Point)

	GetStringSet() StringSet
	SetStringSet(v StringSet)

	GetTabSize() DimOrS
	SetTabSize(v DimOrS)

	GetTableLayout() String
	SetTableLayout(v String)

	GetTextAlignAll() String
	SetTextAlignAll(v String)

	GetTextAlignLast() String
	SetTextAlignLast(v String)

	GetTextDecorationColor() Color
	SetTextDecorationColor(v Color)

	GetTextDecorationLine() Decorations
	SetTextDecorationLine(v Decorations)

	GetTextDecorationStyle() String
	SetTextDecorationStyle(v String)

	GetTextIndent() DimOrS
	SetTextIndent(v DimOrS)

	GetTextOverflow() String
	SetTextOverflow(v String)

	GetTextTransform() String
	SetTextTransform(v String)

	GetTop() DimOrS
	SetTop(v DimOrS)

	GetTransform() Transforms
	SetTransform(v Transforms)

	GetTransformOrigin() Point
	SetTransformOrigin(v Point)

	GetUnicodeBidi() String
	SetUnicodeBidi(v String)

	GetVerticalAlign() DimOrS
	SetVerticalAlign(v DimOrS)

	GetVisibility() String
	SetVisibility(v String)

	GetWhiteSpace() String
	SetWhiteSpace(v String)

	GetWidows() Int
	SetWidows(v Int)

	GetWidth() DimOrS
	SetWidth(v DimOrS)

	GetWordBreak() String
	SetWordBreak(v String)

	GetWordSpacing() DimOrS
	SetWordSpacing(v DimOrS)

	GetZIndex() IntString
	SetZIndex(v IntString)
}

type Tag added in v0.0.2

type Tag uint8

Tag is a flag indicating special values, such as "none" or "auto".

const (
	Auto    Tag // "auto"
	None        // "none"
	Span        // "span"
	Subgrid     // "subgrid"
	Attr        // "attr()"
)

type TaggedInt added in v0.0.2

type TaggedInt struct {
	I   int
	Tag Tag
}

type TaggedString added in v0.0.2

type TaggedString struct {
	S   string
	Tag Tag
}

type TextRatioCache added in v0.0.3

type TextRatioCache struct {
	// contains filtered or unexported fields
}

TextRatioCache stores the 1ex/font_size or 1ch/font_size ratios, for each font.

func NewTextRatioCache added in v0.0.3

func NewTextRatioCache() TextRatioCache

func (TextRatioCache) Get added in v0.0.3

func (tr TextRatioCache) Get(fontKey string, isCh bool) (f Float, ok bool)

func (TextRatioCache) Set added in v0.0.3

func (tr TextRatioCache) Set(fontKey string, isCh bool, f Float)

type Transforms

type Transforms []SDimensions

type Unit

type Unit uint8
const (
	Scalar Unit = iota + 1 // means no unit, but a valid value
	Perc                   // percentage (%)
	Ex
	Em
	Ch
	Rem
	Px
	Pt
	Pc
	In
	Cm
	Mm
	Q

	Rad
	Turn
	Deg
	Grad

	Fr
)

func (Unit) String added in v0.0.10

func (u Unit) String() string

type UrlImage

type UrlImage string

type Values

type Values []DimOrS

func (Values) Repeat added in v0.0.10

func (bs Values) Repeat(n int) Values

type VarData

type VarData struct {
	Name    string // name of a custom property
	Default RawTokens
}

func (VarData) IsNone

func (v VarData) IsNone() bool

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL