Skip to content

package functions

import "kaiju/markup/css/functions"

Variables

FunctionMap

map[string]Function{
    "attr":                      Attr{},
    "calc":                      Calc{},
    "conic-gradient":            ConicGradient{},
    "counter":                   Counter{},
    "cubic-bezier":              CubicBezier{},
    "hsl":                       Hsl{},
    "hsla":                      Hsla{},
    "linear-gradient":           LinearGradient{},
    "max":                       Max{},
    "min":                       Min{},
    "radial-gradient":           RadialGradient{},
    "repeating-conic-gradient":  RepeatingConicGradient{},
    "repeating-linear-gradient": RepeatingLinearGradient{},
    "repeating-radial-gradient": RepeatingRadialGradient{},
    "rgb":                       Rgb{},
    "rgba":                      Rgba{},
    "var":                       Var{},
}

Types

Attr

struct

type Attr struct{}

Returns the value of an attribute of the selected element

Attr.Key

func (f Attr) Key() string

Attr.Process

func (f Attr) Process(panel *ui.Panel, elm *document.Element, value rules.PropertyValue) (string, error)

Calc

struct

type Calc struct{}

Allows you to perform calculations to determine CSS property values

Calc.Key

func (f Calc) Key() string

Calc.Process

func (f Calc) Process(panel *ui.Panel, elm *document.Element, value rules.PropertyValue) (string, error)

ConicGradient

struct

type ConicGradient struct{}

Creates a conic gradient

ConicGradient.Key

func (f ConicGradient) Key() string

ConicGradient.Process

func (f ConicGradient) Process(panel *ui.Panel, elm *document.Element, value rules.PropertyValue) (string, error)

Counter

struct

type Counter struct{}

Returns the current value of the named counter

Counter.Key

func (f Counter) Key() string

Counter.Process

func (f Counter) Process(panel *ui.Panel, elm *document.Element, value rules.PropertyValue) (string, error)

CubicBezier

struct

type CubicBezier struct{}

Defines a Cubic Bezier curve

CubicBezier.Key

func (f CubicBezier) Key() string

CubicBezier.Process

func (f CubicBezier) Process(panel *ui.Panel, elm *document.Element, value rules.PropertyValue) (string, error)

Function

interface

type Function interface {
    Key() string
    Process(panel *ui.Panel, elm *document.Element, value rules.PropertyValue) (string, error)
}

Hsl

struct

type Hsl struct{}

Defines colors using the Hue-Saturation-Lightness model (HSL)

Hsl.Key

func (f Hsl) Key() string

Hsl.Process

func (f Hsl) Process(panel *ui.Panel, elm *document.Element, value rules.PropertyValue) (string, error)

Hsla

struct

type Hsla struct{}

Defines colors using the Hue-Saturation-Lightness-Alpha model (HSLA)

Hsla.Key

func (f Hsla) Key() string

Hsla.Process

func (f Hsla) Process(panel *ui.Panel, elm *document.Element, value rules.PropertyValue) (string, error)

LinearGradient

struct

type LinearGradient struct{}

Creates a linear gradient

LinearGradient.Key

func (f LinearGradient) Key() string

LinearGradient.Process

func (f LinearGradient) Process(panel *ui.Panel, elm *document.Element, value rules.PropertyValue) (string, error)

Max

struct

type Max struct{}

Uses the largest value, from a comma-separated list of values, as the property value

Max.Key

func (f Max) Key() string

Max.Process

func (f Max) Process(panel *ui.Panel, elm *document.Element, value rules.PropertyValue) (string, error)

Min

struct

type Min struct{}

Uses the smallest value, from a comma-separated list of values, as the property value

Min.Key

func (f Min) Key() string

Min.Process

func (f Min) Process(panel *ui.Panel, elm *document.Element, value rules.PropertyValue) (string, error)

RadialGradient

struct

type RadialGradient struct{}

Creates a radial gradient

RadialGradient.Key

func (f RadialGradient) Key() string

RadialGradient.Process

func (f RadialGradient) Process(panel *ui.Panel, elm *document.Element, value rules.PropertyValue) (string, error)

RepeatingConicGradient

struct

type RepeatingConicGradient struct{}

Repeats a conic gradient

RepeatingConicGradient.Key

func (f RepeatingConicGradient) Key() string

RepeatingConicGradient.Process

func (f RepeatingConicGradient) Process(panel *ui.Panel, elm *document.Element, value rules.PropertyValue) (string, error)

RepeatingLinearGradient

struct

type RepeatingLinearGradient struct{}

Repeats a linear gradient

RepeatingLinearGradient.Key

func (f RepeatingLinearGradient) Key() string

RepeatingLinearGradient.Process

func (f RepeatingLinearGradient) Process(panel *ui.Panel, elm *document.Element, value rules.PropertyValue) (string, error)

RepeatingRadialGradient

struct

type RepeatingRadialGradient struct{}

Repeats a radial gradient

RepeatingRadialGradient.Key

func (f RepeatingRadialGradient) Key() string

RepeatingRadialGradient.Process

func (f RepeatingRadialGradient) Process(panel *ui.Panel, elm *document.Element, value rules.PropertyValue) (string, error)

Rgb

struct

type Rgb struct{}

Defines colors using the Red-Green-Blue model (RGB)

Rgb.Key

func (f Rgb) Key() string

Rgb.Process

func (f Rgb) Process(panel *ui.Panel, elm *document.Element, value rules.PropertyValue) (string, error)

Rgba

struct

type Rgba struct{}

Defines colors using the Red-Green-Blue-Alpha model (RGBA)

Rgba.Key

func (f Rgba) Key() string

Rgba.Process

func (f Rgba) Process(panel *ui.Panel, elm *document.Element, value rules.PropertyValue) (string, error)

Var

struct

type Var struct{}

Inserts the value of a custom property

Var.Key

func (f Var) Key() string

Var.Process

func (f Var) Process(panel *ui.Panel, elm *document.Element, value rules.PropertyValue) (string, error)