webstyle

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2026 License: Apache-2.0 Imports: 5 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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

Constants

This section is empty.

Variables

View Source
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 Color

func Color(c driver.Color) string

Color is c as CSS.

func Decoration

func Decoration(d driver.TextDecoration) string

Decoration is CSS's text-decoration-line of d, "none" for none.

func Easing

func Easing(c driver.Curve) string

Easing is the CSS timing function of a curve, linear for none.

func Fill

func Fill(c driver.Color) string

Fill is the CSS of a background or border color, "" for none.

func Filter

func Filter(filters []driver.Filter) string

Filter is CSS's filter of filters, or "" 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 Opacity

func Opacity(o float32) string

Opacity is the CSS of an opacity, "" for opaque.

func Px

func Px(p driver.Points) string

Px is p in CSS pixels.

func Radius

func Radius(vs *driver.ViewStyle) string

Radius is the border-radius of vs, which the browser fits.

func Shadow

func Shadow(vs *driver.ViewStyle) string

Shadow is the box-shadow of vs: its layers, then React Native's shadow under them.

func TextShadow

func TextShadow(s driver.TextShadow) string

TextShadow is the CSS of a text shadow.

func Transform

func Transform(t driver.Transform) string

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.

Jump to

Keyboard shortcuts

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