Documentation
¶
Overview ¶
Package webstyle writes NSGo's styles as CSS, for the backends that draw with a browser's engine: the web and WeChat mini programs, whose render layer is a web view. It is plain Go, so it is tested on any host.
Lengths are CSS pixels, which are points; what is at CSS's initial value comes back empty, so callers leave the property out.
Index ¶
- Variables
- func Color(c driver.Color) string
- func Decoration(d driver.TextDecoration) string
- func Easing(c driver.Curve) string
- func Fill(c driver.Color) string
- func Filter(filters []driver.Filter) string
- func Gradient(p *driver.GradientPaint, size driver.Size) string
- func LineStyle(s driver.BorderStyle) string
- func Opacity(o float32) string
- func Px(p driver.Points) string
- func Radius(vs *driver.ViewStyle) string
- func Shadow(vs *driver.ViewStyle) string
- func TextShadow(s driver.TextShadow) string
- func Transform(t driver.Transform) string
- func Transition(t driver.Transition) string
Constants ¶
This section is empty.
Variables ¶
var DecorationStyles = map[driver.TextDecorationStyle]string{ 0: "solid", driver.DecorationSolid: "solid", driver.DecorationDouble: "double", driver.DecorationDotted: "dotted", driver.DecorationDashed: "dashed", driver.DecorationWavy: "wavy", }
DecorationStyles are the CSS of the decoration styles.
Functions ¶
func Decoration ¶
func Decoration(d driver.TextDecoration) string
Decoration is CSS's text-decoration-line of d, "none" for none.
func Gradient ¶
func Gradient(p *driver.GradientPaint, size driver.Size) string
Gradient is the CSS gradient of p on a box of size.
func LineStyle ¶
func LineStyle(s driver.BorderStyle) string
LineStyle is the CSS of a border or outline style.
func TextShadow ¶
func TextShadow(s driver.TextShadow) string
TextShadow is the CSS of a text shadow.
func Transform ¶
Transform is t around the view's transform origin, in its order: perspective, translate, rotate, rotateX, rotateY, rotateZ, skew, then scale.
func Transition ¶
func Transition(t driver.Transition) string
Transition animates the listed properties from what the view shows to what the same style change sets.
Types ¶
This section is empty.