set

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2020 License: AGPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Top side = iota
	Bottom
	Left
	Right
)

Direction constants.

Variables

This section is empty.

Functions

func Angle

func Angle(angle float64) css.Rules

Angle sets the rotation angle of this seed.

func Margin

func Margin(first units.Unit, more ...units.Unit) css.Rule

Margin sets the outer-spacing of this seed. If more than one argument is provided different sides are padded. eg.

Margin(all)
Margin(x, y)
Margin(x, top, bottom)
Margin(left, right, top, bottom)

if more than 4 arguments are given, all but the first four are ignored.

func OnHover

func OnHover(styles ...Style) seed.Option

OnHover applies the given Styles when the user is hovering over the seed.

func Padding

func Padding(first units.Unit, more ...units.Unit) css.Rule

Padding sets the inner-spacing of this seed. If more than one argument is provided different sides are padded. eg.

Padding(all)
Padding(x, y)
Padding(x, top, bottom)
Padding(left, right, top, bottom)

if more than 4 arguments are given, all but the first four are ignored.

func Rounded

func Rounded(first units.Unit, more ...units.Unit) css.Rule

Rounded sets how round this seed is, by rounding it's corners. If more than one argument is provided different corners are rounded differently. eg.

Rounded(top, bottom)
Rounded(top, bottom_left, bottom_right)
Rounded(top_left, top_right, bottom_left, bottom_right)

if more than 4 arguments are given, all but the first four are ignored.

func Scale

func Scale(factor float64) css.Rules

Scale sets the scale of this seed.

func Translation

func Translation(x, y units.Unit) css.Rules

Translation sets the translation of this seed.

func Visible

func Visible() css.Rule

Visible sets the seed to be visible.

Types

type BorderStyle

type BorderStyle int

BorderStyle determines how a border is rendered.

const (
	Solid BorderStyle = iota
	Dashed
)

BorderStyles

type Condition

type Condition struct {
	// contains filtered or unexported fields
}

Condition backs the If variable and can apply conditional styles.

var If Condition

If allows conditional styles.

func (Condition) AddTo

func (con Condition) AddTo(c seed.Seed)

func (Condition) And

func (con Condition) And(options ...seed.Option) seed.Option

func (Condition) Huge

func (con Condition) Huge(styles ...Style) Condition

func (Condition) Landscape

func (con Condition) Landscape(styles ...Style) Condition

func (Condition) Large

func (con Condition) Large(styles ...Style) Condition

func (Condition) Medium

func (con Condition) Medium(styles ...Style) Condition

func (Condition) Portrait

func (con Condition) Portrait(styles ...Style) Condition

func (Condition) Small

func (con Condition) Small(styles ...Style) Condition

func (Condition) Tiny

func (con Condition) Tiny(styles ...Style) Condition

Tiny applies the styles on tiny screens. ie. SmartWatches.

type Gradient

type Gradient struct {
	From, To  color.Color
	Colors    []color.Color
	Ratios    []float64
	Direction complex128

	Repeating, Radial, Circle bool

	Size    complex128
	Closest bool
	Side    bool
}

Gradient is a color gradient from one color to another.

func (Gradient) AddTo

func (gradient Gradient) AddTo(c seed.Seed)

AddTo implements seed.Option

type Shadow

type Shadow struct {
	X, Y, Blur, Spread units.Unit
	Color              color.Color

	Inset bool
}

Shadow Defines a shadow that should be applied to the Element, with offset X and Y, Blur and of the specified color.

func (Shadow) AddTo

func (shadow Shadow) AddTo(c seed.Seed)

type Style

type Style interface {
	seed.Option
	Rules() css.Rules
}

Style is a setter that wraps css styling.

func Border

func Border(s BorderStyle) Style

Border sets the border style.

func BorderColor

func BorderColor(c color.Color) Style

BorderColor sets the border color of the seed.

func BorderWidth

func BorderWidth(w units.Unit) Style

BorderWidth sets the width of the border.

func Borderless

func Borderless() Style

Borderless removes the border of the seed.

func BottomLeftRounding

func BottomLeftRounding(u units.Unit) Style

BottomLeftRounding sets the bottom-left rounding of this seed.

func BottomRightRounding

func BottomRightRounding(u units.Unit) Style

BottomRightRounding sets the bottom-right rounding of this seed.

func Clipped

func Clipped() Style

Clipped sets this seed to clip any children that cross the border.

func Color

func Color(c color.Color) Style

Color sets the color of this seed.

func Height

func Height(w units.Unit) Style

Height sets the target height of this seed.

func Hidden

func Hidden() Style

Hidden removes this seed from taking space and being visible.

func Layer

func Layer(layer int) Style

Layer sets the z-index of this seed. this will influence the rendering order.

func MarginBottom

func MarginBottom(u units.Unit) Style

MarginBottom sets the bottom outer-spacing of this seed.

func MarginLeft

func MarginLeft(u units.Unit) Style

MarginLeft sets the outer-spacing to the left of this seed.

func MarginRight

func MarginRight(u units.Unit) Style

MarginRight sets the outer-spacing to the right of this seed.

func MarginTop

func MarginTop(u units.Unit) Style

MarginTop sets the top outer-spacing of this seed.

func MaxHeight

func MaxHeight(w units.Unit) Style

MaxHeight sets the maximum height of this seed.

func MaxWidth

func MaxWidth(w units.Unit) Style

MaxWidth sets the maximum width of this seed.

func MinHeight

func MinHeight(w units.Unit) Style

MinHeight sets the minumum height of this seed.

func MinWidth

func MinWidth(w units.Unit) Style

MinWidth sets the minumum width of this seed.

func OffsetBottom

func OffsetBottom(u units.Unit) Style

OffsetBottom sets the bottom offset of this seed.

func OffsetLeft

func OffsetLeft(u units.Unit) Style

OffsetLeft sets the offset to the left of this seed.

func OffsetRight

func OffsetRight(u units.Unit) Style

OffsetRight sets the offset to the right of this seed.

func OffsetTop

func OffsetTop(u units.Unit) Style

OffsetTop sets the top offset of this seed.

func Opacity

func Opacity(v float64) Style

Opacity sets the transparency of this seed.

func Overlay

func Overlay(attachto ...side) Style

Overlay positions this seed overlayed on its parent.

func PaddingBottom

func PaddingBottom(u units.Unit) Style

PaddingBottom sets the bottom inner-spacing of this seed.

func PaddingLeft

func PaddingLeft(u units.Unit) Style

PaddingLeft sets the inner-spacing to the left of this seed.

func PaddingRight

func PaddingRight(u units.Unit) Style

PaddingRight sets the inner-spacing to the right of this seed.

func PaddingTop

func PaddingTop(u units.Unit) Style

PaddingTop sets the top inner-spacing of this seed.

func Scrollable

func Scrollable() Style

Scrollable sets this to seed to be scrollable if it's height overflows. If the container is getting cut off, ensure that a parent seed as MinHeight set to 0.

func Size

func Size(w, h units.Unit) Style

Size sets the target size of this seed.

func Sticky

func Sticky(attachto ...side) Style

Sticky keeps this seed on the screen when scrolling.

func TopLeftRounding

func TopLeftRounding(u units.Unit) Style

TopLeftRounding sets the top-left rounding of this seed.

func TopRightRounding

func TopRightRounding(u units.Unit) Style

TopRightRounding sets the top-right rounding of this seed.

func Width

func Width(w units.Unit) Style

Width sets the target width of this seed.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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