style

package
v0.0.0-...-1210f28 Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2017 License: ISC Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type PropertyMap

type PropertyMap map[string]css.Value

A PropertyMap maps a property name to a CSS value. TODO should this really be exported?

func MatchNode

func MatchNode(node dom.Node, def, user, author *css.Stylesheet, pseudo string) PropertyMap

MatchNode creates the PropertyMap for node, given the default, user and author stylesheets.

type Style

type Style struct {
	SpecifiedValues PropertyMap
	ComputedValues  PropertyMap // This is just a cache
	Parent          *Style
	Node            dom.Node
	Children        []*Style
}

A Style represents a full CSS style. This includes looking up inherited values. It also knowns about the tree structure?! TODO rename

func BuildTree

func BuildTree(node dom.Node, def, user, author *css.Stylesheet) *Style

func (*Style) Computed

func (s *Style) Computed(prop string) (val css.Value)

Computed is the computed value of the property prop.

func (*Style) Font

func (s *Style) Font() font.Query

Font creates a font query that may be used by a system dependent font loader to find and load the most suitable font.

func (*Style) Specified

func (s *Style) Specified(prop string) css.Value

Specified is the specified value of the property prop.

func (*Style) String

func (s *Style) String() string

func (*Style) Used

func (s *Style) Used(prop string) css.Value

Used is the used value of property s.

func (*Style) WriteTo

func (s *Style) WriteTo(w io.Writer) error

Jump to

Keyboard shortcuts

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