css_ast

package
v0.8.39 Latest Latest
Warning

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

Go to latest
Published: Feb 1, 2021 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var KnownDeclarations = map[string]D{}/* 315 elements not displayed */

Functions

This section is empty.

Types

type AST

type AST struct {
	ImportRecords []ast.ImportRecord
	Rules         []R
}

type ComplexSelector

type ComplexSelector struct {
	Selectors []CompoundSelector
}

type CompoundSelector

type CompoundSelector struct {
	HasNestPrefix        bool   // "&"
	Combinator           string // Optional, may be ""
	TypeSelector         *NamespacedName
	SubclassSelectors    []SS
	PseudoClassSelectors []SSPseudoClass // If present, these follow a ":" character
}

type D added in v0.7.9

type D uint16
const (
	DUnknown D = iota
	DAlignContent
	DAlignItems
	DAlignSelf
	DAlignmentBaseline
	DAll
	DAnimation
	DAnimationDelay
	DAnimationDirection
	DAnimationDuration
	DAnimationFillMode
	DAnimationIterationCount
	DAnimationName
	DAnimationPlayState
	DAnimationTimingFunction
	DBackfaceVisibility
	DBackground
	DBackgroundAttachment
	DBackgroundClip
	DBackgroundColor
	DBackgroundImage
	DBackgroundOrigin
	DBackgroundPosition
	DBackgroundPositionX
	DBackgroundPositionY
	DBackgroundRepeat
	DBackgroundSize
	DBaselineShift
	DBlockSize
	DBorder
	DBorderBlockEnd
	DBorderBlockEndColor
	DBorderBlockEndStyle
	DBorderBlockEndWidth
	DBorderBlockStart
	DBorderBlockStartColor
	DBorderBlockStartStyle
	DBorderBlockStartWidth
	DBorderBottom
	DBorderBottomColor
	DBorderBottomLeftRadius
	DBorderBottomRightRadius
	DBorderBottomStyle
	DBorderBottomWidth
	DBorderCollapse
	DBorderColor
	DBorderImage
	DBorderImageOutset
	DBorderImageRepeat
	DBorderImageSlice
	DBorderImageSource
	DBorderImageWidth
	DBorderInlineEnd
	DBorderInlineEndColor
	DBorderInlineEndStyle
	DBorderInlineEndWidth
	DBorderInlineStart
	DBorderInlineStartColor
	DBorderInlineStartStyle
	DBorderInlineStartWidth
	DBorderLeft
	DBorderLeftColor
	DBorderLeftStyle
	DBorderLeftWidth
	DBorderRadius
	DBorderRight
	DBorderRightColor
	DBorderRightStyle
	DBorderRightWidth
	DBorderSpacing
	DBorderStyle
	DBorderTop
	DBorderTopColor
	DBorderTopLeftRadius
	DBorderTopRightRadius
	DBorderTopStyle
	DBorderTopWidth
	DBorderWidth
	DBottom
	DBoxShadow
	DBoxSizing
	DBreakAfter
	DBreakBefore
	DBreakInside
	DCaptionSide
	DCaretColor
	DClear
	DClip
	DClipPath
	DClipRule
	DColor
	DColorInterpolation
	DColorInterpolationFilters
	DColumnCount
	DColumnFill
	DColumnGap
	DColumnRule
	DColumnRuleColor
	DColumnRuleStyle
	DColumnRuleWidth
	DColumnSpan
	DColumnWidth
	DColumns
	DContent
	DCounterIncrement
	DCounterReset
	DCssFloat
	DCssText
	DCursor
	DDirection
	DDisplay
	DDominantBaseline
	DEmptyCells
	DFill
	DFillOpacity
	DFillRule
	DFilter
	DFlex
	DFlexBasis
	DFlexDirection
	DFlexFlow
	DFlexGrow
	DFlexShrink
	DFlexWrap
	DFloat
	DFloodColor
	DFloodOpacity
	DFont
	DFontFamily
	DFontFeatureSettings
	DFontKerning
	DFontSize
	DFontSizeAdjust
	DFontStretch
	DFontStyle
	DFontSynthesis
	DFontVariant
	DFontVariantCaps
	DFontVariantEastAsian
	DFontVariantLigatures
	DFontVariantNumeric
	DFontVariantPosition
	DFontWeight
	DGap
	DGlyphOrientationVertical
	DGrid
	DGridArea
	DGridAutoColumns
	DGridAutoFlow
	DGridAutoRows
	DGridColumn
	DGridColumnEnd
	DGridColumnGap
	DGridColumnStart
	DGridGap
	DGridRow
	DGridRowEnd
	DGridRowGap
	DGridRowStart
	DGridTemplate
	DGridTemplateAreas
	DGridTemplateColumns
	DGridTemplateRows
	DHeight
	DHyphens
	DImageOrientation
	DImageRendering
	DInlineSize
	DJustifyContent
	DJustifyItems
	DJustifySelf
	DLeft
	DLetterSpacing
	DLightingColor
	DLineBreak
	DLineHeight
	DListStyle
	DListStyleImage
	DListStylePosition
	DListStyleType
	DMargin
	DMarginBlockEnd
	DMarginBlockStart
	DMarginBottom
	DMarginInlineEnd
	DMarginInlineStart
	DMarginLeft
	DMarginRight
	DMarginTop
	DMarker
	DMarkerEnd
	DMarkerMid
	DMarkerStart
	DMask
	DMaskComposite
	DMaskImage
	DMaskPosition
	DMaskRepeat
	DMaskSize
	DMaskType
	DMaxBlockSize
	DMaxHeight
	DMaxInlineSize
	DMaxWidth
	DMinBlockSize
	DMinHeight
	DMinInlineSize
	DMinWidth
	DObjectFit
	DObjectPosition
	DOpacity
	DOrder
	DOrphans
	DOutline
	DOutlineColor
	DOutlineOffset
	DOutlineStyle
	DOutlineWidth
	DOverflow
	DOverflowAnchor
	DOverflowWrap
	DOverflowX
	DOverflowY
	DOverscrollBehavior
	DOverscrollBehaviorBlock
	DOverscrollBehaviorInline
	DOverscrollBehaviorX
	DOverscrollBehaviorY
	DPadding
	DPaddingBlockEnd
	DPaddingBlockStart
	DPaddingBottom
	DPaddingInlineEnd
	DPaddingInlineStart
	DPaddingLeft
	DPaddingRight
	DPaddingTop
	DPageBreakAfter
	DPageBreakBefore
	DPageBreakInside
	DPaintOrder
	DPerspective
	DPerspectiveOrigin
	DPlaceContent
	DPlaceItems
	DPlaceSelf
	DPointerEvents
	DPosition
	DQuotes
	DResize
	DRight
	DRotate
	DRowGap
	DRubyAlign
	DRubyPosition
	DScale
	DScrollBehavior
	DShapeRendering
	DStopColor
	DStopOpacity
	DStroke
	DStrokeDasharray
	DStrokeDashoffset
	DStrokeLinecap
	DStrokeLinejoin
	DStrokeMiterlimit
	DStrokeOpacity
	DStrokeWidth
	DTabSize
	DTableLayout
	DTextAlign
	DTextAlignLast
	DTextAnchor
	DTextCombineUpright
	DTextDecoration
	DTextDecorationColor
	DTextDecorationLine
	DTextDecorationStyle
	DTextEmphasis
	DTextEmphasisColor
	DTextEmphasisPosition
	DTextEmphasisStyle
	DTextIndent
	DTextJustify
	DTextOrientation
	DTextOverflow
	DTextRendering
	DTextShadow
	DTextTransform
	DTextUnderlinePosition
	DTop
	DTouchAction
	DTransform
	DTransformBox
	DTransformOrigin
	DTransformStyle
	DTransition
	DTransitionDelay
	DTransitionDuration
	DTransitionProperty
	DTransitionTimingFunction
	DTranslate
	DUnicodeBidi
	DUserSelect
	DVerticalAlign
	DVisibility
	DWhiteSpace
	DWidows
	DWidth
	DWillChange
	DWordBreak
	DWordSpacing
	DWordWrap
	DWritingMode
	DZIndex
	DZoom
)

type KeyframeBlock added in v0.7.8

type KeyframeBlock struct {
	Selectors []string
	Rules     []R
}

type NameToken added in v0.7.20

type NameToken struct {
	Kind css_lexer.T
	Text string
}

type NamespacedName

type NamespacedName struct {
	// If present, this is an identifier or "*" and is followed by a "|" character
	NamespacePrefix *NameToken

	// This is an identifier or "*" or "&"
	Name NameToken
}

type R

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

This interface is never called. Its purpose is to encode a variant type in Go's type system.

type RAtCharset added in v0.7.7

type RAtCharset struct {
	Encoding string
}

type RAtImport

type RAtImport struct {
	ImportRecordIndex uint32
}

type RAtKeyframes added in v0.7.8

type RAtKeyframes struct {
	AtToken string
	Name    string
	Blocks  []KeyframeBlock
}

type RAtNamespace added in v0.7.7

type RAtNamespace struct {
	Prefix string
	Path   string
}

type RBadDeclaration

type RBadDeclaration struct {
	Tokens []Token
}

type RDeclaration

type RDeclaration struct {
	KeyText   string
	Value     []Token
	KeyRange  logger.Range
	Key       D // Compare using this instead of "Key" for speed
	Important bool
}

type RKnownAt

type RKnownAt struct {
	AtToken string
	Prelude []Token
	Rules   []R
}

type RQualified

type RQualified struct {
	Prelude []Token
	Rules   []R
}

type RSelector

type RSelector struct {
	Selectors []ComplexSelector
	Rules     []R
}

type RUnknownAt

type RUnknownAt struct {
	AtToken string
	Prelude []Token
	Block   []Token
}

type SS

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

This interface is never called. Its purpose is to encode a variant type in Go's type system.

type SSAttribute

type SSAttribute struct {
	NamespacedName  NamespacedName
	MatcherOp       string
	MatcherValue    string
	MatcherModifier byte
}

type SSClass

type SSClass struct {
	Name string
}

type SSHash

type SSHash struct {
	Name string
}

type SSPseudoClass

type SSPseudoClass struct {
	Name string
	Args []Token
}

type Token added in v0.7.8

type Token struct {
	// This is the raw contents of the token most of the time. However, it
	// contains the decoded string contents for "TString" tokens.
	Text string // 16 bytes

	// Contains the child tokens for component values that are simple blocks.
	// These are either "(", "{", "[", or function tokens. The closing token is
	// implicit and is not stored.
	Children *[]Token // 8 bytes

	// URL tokens have an associated import record at the top-level of the AST.
	// This index points to that import record.
	ImportRecordIndex uint32 // 4 bytes

	// The division between the number and the unit for "TDimension" tokens.
	UnitOffset uint16 // 2 bytes

	// This will never be "TWhitespace" because whitespace isn't stored as a
	// token directly. Instead it is stored in "HasWhitespaceAfter" on the
	// previous token.
	Kind css_lexer.T // 1 byte

	// This is generally true if there was a "TWhitespace" token before this
	// token. This isn't strictly true in some cases because sometimes this flag
	// is changed to make the generated code look better (e.g. around commas).
	HasWhitespaceAfter bool // 1 byte
}

We create a lot of tokens, so make sure this layout is memory-efficient. The layout here isn't optimal because it biases for convenience (e.g. "string" could be shorter) but at least the ordering of fields was deliberately chosen to minimize size.

func (Token) DimensionUnit added in v0.7.9

func (t Token) DimensionUnit() string

func (Token) DimensionValue added in v0.7.9

func (t Token) DimensionValue() string

func (Token) PercentValue added in v0.7.9

func (t Token) PercentValue() string

Jump to

Keyboard shortcuts

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