Documentation ¶
Index ¶
- Constants
- Variables
- func FetchNodeMap(doc *html.Node, cssText string) (m map[*html.Node]Map, err error)
- func FetchNodeRules(doc *html.Node, cssText string) (m map[*html.Node][]Rule, rVars map[string]string, err error)
- func Init(d *duit.DUI)
- func MatchQuery(mediaQuery string, values map[string]string) (yes bool, err error)
- func MergeNodeMaps(m, addOn map[*html.Node]Map)
- func Preprocess(s string) (bs []byte, ct opossum.ContentType, imports []string, err error)
- func SetFetcher(f opossum.Fetcher)
- type Declaration
- type DomTree
- type Map
- func (cs Map) ApplyChildStyle(ccs Map, copyAll bool) (res Map)
- func (cs Map) BackgroundGradient() (img *draw.Image)
- func (cs Map) BoxBackground() (i *draw.Image, err error)
- func (cs Map) Color() draw.Color
- func (cs Map) Css(propName string) string
- func (cs *Map) CssPx(propName string) (l int, err error)
- func (cs Map) Font() *draw.Font
- func (cs Map) FontFilename() (string, bool)
- func (cs Map) FontHeight() float64
- func (cs Map) FontSize() float64
- func (cs *Map) Height() int
- func (cs Map) IsDisplayNone() bool
- func (cs Map) IsFlex() bool
- func (cs Map) IsFlexDirectionRow() bool
- func (cs Map) IsInline() bool
- func (cs Map) SetCss(k, v string)
- func (cs *Map) Tlbr(key string) (s duit.Space, err error)
- func (cs Map) Width() int
- type MediaExpr
- type MediaQuery
- type Rule
- type Selector
- type Sheet
Constants ¶
View Source
const AddOnCSS = `` /* 965-byte string literal not displayed */
View Source
const FontBaseSize = 11.0
Variables ¶
View Source
var MediaValues = map[string]string{ "type": "screen", "width": fmt.Sprintf("%vpx", WindowWidth), "orientation": "landscape", "prefers-color-scheme": "dark", }
View Source
var TextNode = Map{ Declarations: map[string]Declaration{ "display": Declaration{ Prop: "display", Val: "inline", }, }, }
View Source
var WindowHeight = 1080
View Source
var WindowWidth = 1280
Functions ¶
func FetchNodeMap ¶
func FetchNodeRules ¶
func MatchQuery ¶
func MergeNodeMaps ¶
func Preprocess ¶
func SetFetcher ¶
Types ¶
type Declaration ¶
type Declaration struct { Important bool Specificity cascadia.Specificity Prop string Val string }
type Map ¶
type Map struct { Declarations map[string]Declaration DomTree `json:"-"` }
func (Map) BackgroundGradient ¶
BackgroundGradient is a stub implemention right now (TODO)
func (Map) FontFilename ¶
func (Map) IsDisplayNone ¶
func (Map) IsFlexDirectionRow ¶
type MediaQuery ¶
type MediaQuery struct {
// contains filtered or unexported fields
}
Click to show internal directories.
Click to hide internal directories.