css package - github.com/napsy/go-css - Go Packages (original) (raw)

This section is empty.

View Source

var StylesTable = map[string]StyleHandler{ "background": background, "background-attachment": backgroundAttachment, "background-color": backgroundColor, "background-image": backgroundImage, "background-position": backgroundPosition, "background-repeat": backgroundRepeat, "border": border, "border-bottom": borderBottom, "border-bottom-color": borderBottomColor, "border-bottom-style": borderBottomStyle, "border-bottom-width": borderBottomWidth, "border-color": borderColor, "border-left": borderLeft, "border-left-color": borderLeftColor, "border-left-style": borderLeftStyle, "border-left-width": borderLeftWidth, "border-right": borderRight, "border-right-color": borderRightColor, "border-right-style": borderRightStyle, "border-right-width": borderRightWidth, "border-style": borderStyle, "border-top": borderTop, "border-top-color": borderTopColor, "border-top-style": borderTopStyle, "border-top-width": borderTopWidth, "border-width": borderWidth, "clear": clear, "clip": clip, "color": color, "cursor": cursor, "display": display, "filter": filter, "font": font, "font-family": fontFamily, "font-size": fontSize, "font-variant": fontVariant, "font-weight": fontWeight, "height": height, "left": left, "letter-spacing": letterSpacing, "line-height": lineHeight, "list-style": listStyle, "list-style-image": listStyleImage, "list-style-position": listStylePosition, "list-style-type": listStyleType, "margin": margin, "margin-bottom": marginBottom, "margin-left": marginLeft, "margin-right": marginRight, "margin-top": marginTop, "overflow": overflow, "padding": padding, "padding-bottom": paddingBottom, "padding-left": paddingLeft, "padding-right": paddingRight, "padding-top": paddingTop, "page-break-after": pageBreakAfter, "page-break-before": pageBreakBefore, "position": position, "float": float, "text-align": textAlign, "text-decoration": textDecoration, "text-decoration: blink": textDecorationBlink, "text-decoration: line-through": textDecorationLineThrough, "text-decoration: none": textDecorationNone, "text-decoration: overline": textDecorationOverline, "text-decoration: underline": textDecorationUnderline, "text-indent": textIndent, "text-transform": textTransform, "top": top, "vertical-align": verticalAlign, "visibility": visibility, "width": width, "z-index": zIndex, }

Common CSS styles. You can overwrite the handlers with your own.

Unmarshal will take a byte slice, containing sylesheet rules and return a map of a rules map.

Rule is a string type that represents a CSS rule.

Type returns the rule type, which can be a class, id or a tag.

type Style struct { Value interface{}

}

CSSStyle returns an error-checked parsed style, or an error if the style is unknown. Most of the styles are not supported yet.

func (style Style) Unit() UnitType

type StyleHandler

StyleHandler is a function that checks the style value for errors and returns a Style

const ( UnitNone UnitType = iota UnitPixels UnitEm UnitRem UnitPercent UnitPt UnitAuto )