seed: github.com/qlova/seed/style Index | Files | Directories

package style

import "github.com/qlova/seed/style"

Index

Package Files

alignment.go animation.go attach.go borders.go color.go composition.go filter.go fonts.go group.go image.go rules.go scrolling.go shadow.go sheet.go sizing.go spacing.go style.go transform.go

type Aligner Uses

type Aligner interface {
    Start()
    Center()
    End()
}

Aligner aligns items.

type Attacher Uses

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

Attacher is used to specify an attachpoint.

func (Attacher) Bottom Uses

func (a Attacher) Bottom() Attacher

Bottom attaches this to the bottom of the context.

func (Attacher) Left Uses

func (a Attacher) Left() Attacher

Left attaches this to the left of the context.

func (Attacher) Right Uses

func (a Attacher) Right() Attacher

Right attaches this to the right of the context.

func (Attacher) Top Uses

func (a Attacher) Top() Attacher

Top attaches this to the top of the context.

type Font Uses

type Font struct {
    css.FontFace
    // contains filtered or unexported fields
}

Font is a style definition for how text should be rendered.

func NewFont Uses

func NewFont(path string) Font

NewFont creates a new font based on the given font file path.

type Gradient Uses

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

func (Gradient) CSS Uses

func (gradient Gradient) CSS() []byte

CSS returns the gradient as a CSS function.

type Group Uses

type Group struct {
    Style

    Portrait, Landscape Style
}

Group is a complete styleset with default + portrait and landscape

func NewGroup Uses

func NewGroup() *Group

NewGroup returns a pointer to a new initialised style.Group.

func (*Group) Init Uses

func (group *Group) Init()

Init initializes the group.

type Option Uses

type Option func(interface{})

func SetColor Uses

func SetColor(color color.Color) Option

type Rules Uses

type Rules struct {
    Standard map[string][]string
    Extras   map[string]string
}

Rules is a mapping between selectors and styles.

func NewRules Uses

func NewRules() Rules

NewRules returns a new ruleset.

func (Rules) Add Uses

func (rules Rules) Add(selector string, style css.Stylable)

Add adds a new entry to the rules.

func (Rules) AddExtra Uses

func (rules Rules) AddExtra(selector string, style css.Stylable)

AddExtra adds a new unomptimised entry to the rules.

func (Rules) AddStyle Uses

func (rules Rules) AddStyle(selector string, style Style)

AddStyle adds a style to the rules.

func (Rules) Bytes Uses

func (rules Rules) Bytes() []byte

Bytes returns the rules as CSS.

func (Rules) Get Uses

func (rules Rules) Get(selector string) css.Stylable

Get retrieved an entry from the rules.

type Shadow Uses

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

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

type Sheet Uses

type Sheet struct {
    Rules
    Portrait, Landscape Rules
}

Sheet is a CSS stylesheet that produces optimally compressed CSS for Qlovaseed.

func NewSheet Uses

func NewSheet() Sheet

NewSheet returns a new sheet.

func (Sheet) AddGroup Uses

func (sheet Sheet) AddGroup(selector string, group Group)

AddGroup adds a new style group to the sheet.

func (Sheet) Bytes Uses

func (sheet Sheet) Bytes() []byte

Bytes returns the sheet as CSS.

type Spacer Uses

type Spacer interface {
    //Before provides spacing before children. This is like placing an expander before the children.
    Before()

    //Outside provides spacing outside of the children, effectively centering the children.
    //This is like placing an expander before and after the children.
    Outside()

    //Center provides spacing that centers the children.
    Center()

    //After provides spacing after children. This is like placing an expander after the children.
    After()

    //Inside distributes spacing inside children. This is like placing an expander between children.
    Inside()

    //Around distributes spacing around the children. This is like placing an expander before and after every child.
    Around()

    //Divide distributes the spacing evenly. This is like placing an expander before the children, between each child and after the children.
    Divide()
}

Spacer distributes spacing.

type Style Uses

type Style struct {
    Style css.Style
    // contains filtered or unexported fields
}

Style is a set of visual indications of an element. For example, colour, spacing & positioning.

func Compose Uses

func Compose(a, b Style) Style

Compose returns a new style that writes to both input styles.

func From Uses

func From(stylable css.Stylable) Style

From returns a style from a css stylable.

func New Uses

func New() Style

New returns a new Style.

func (Style) Align Uses

func (style Style) Align() Aligner

Align returns an aligner that aligns the seed.

func (Style) AlignItems Uses

func (style Style) AlignItems() Aligner

AlignItems returns an aligner that aligns the children of this seed.

func (Style) Animate Uses

func (style Style) Animate(duration float64)

Animate animates this elements transform.

func (Style) AttachToParent Uses

func (style Style) AttachToParent() Attacher

AttachToParent attaches this element to its parent, returns an attacher to specify where.

func (Style) AttachToScreen Uses

func (style Style) AttachToScreen() Attacher

AttachToScreen attaches this element to the screen, returns an attacher to specify where.

func (Style) Bytes Uses

func (style Style) Bytes() []byte

Bytes return the style as CSS.

func (Style) CSS Uses

func (style Style) CSS() css.Style

Bytes return the style as CSS.

func (Style) Clip Uses

func (style Style) Clip()

Clip clips the content if it would go out of it's container.

func (Style) Compress Uses

func (style Style) Compress()

Compress means this element should shrink to make space for other elements.

func (Style) Copy Uses

func (style Style) Copy() Style

Copy duplicates a style and returns a copy of it.

func (Style) Detach Uses

func (style Style) Detach()

Detach detaches the element from the parent and/or the screen. This causes the element to behave like a default element.

func (Style) DontShrink Uses

func (style Style) DontShrink()

DontShrink means this should not shrink to make space for other elements.

func (Style) Expand Uses

func (style Style) Expand()

Expand sets this element to expand and take up all available space.

func (Style) Fade Uses

func (style Style) Fade(opacity float64)

Fade sets the opacity/transparency of this element.

func (Style) ItemSpacing Uses

func (style Style) ItemSpacing() Spacer

ItemSpacing returns a spacer for distributing spacing to children.

func (Style) RemoveGradient Uses

func (style Style) RemoveGradient()

RemoveGradient removes any gradients from this element.

func (Style) RemoveRoundedCorners Uses

func (style Style) RemoveRoundedCorners()

RemoveRoundedCorners removes any rounded corner specification for this element.

func (Style) RemoveShadow Uses

func (style Style) RemoveShadow()

RemoveShadow removes the shadow on this element.

func (Style) RemoveTextShadow Uses

func (style Style) RemoveTextShadow()

RemoveTextShadow removes the text shadow on this element.

func (Style) Reverse Uses

func (style Style) Reverse()

Reverse sets the attached animation to play in reverse.

func (*Style) Rotate Uses

func (style *Style) Rotate(angle float64)

Rotate the element by the given angle. This overrrides any previous calls to Angle.

func (*Style) RotateX Uses

func (style *Style) RotateX(angle float64)

RotateX the element by the given angle. This overrrides any previous calls to Angle.

func (*Style) Scale Uses

func (style *Style) Scale(scale float64)

Scale the element by the given scale. This overrrides any previous calls to Scale.

func (Style) Select Uses

func (s Style) Select(selector string) Style

Select allows you to select custom style selectors such as :hover

func (Style) SetBold Uses

func (style Style) SetBold()

SetBold sets the text of this element to be bold.

func (Style) SetBorder Uses

func (style Style) SetBorder(color color.Color, thickness int)

SetBorder sets the border of this element to the specified color and thickness.

func (Style) SetBorderless Uses

func (style Style) SetBorderless()

SetBorderless removes the border from this element.

func (Style) SetCol Uses

func (style Style) SetCol()

SetCol sets this element to behave like a column when rendering children (rendering them vertically).

func (Style) SetColor Uses

func (style Style) SetColor(color color.Color)

SetColor sets the color of this element.

func (Style) SetContain Uses

func (style Style) SetContain()

SetContain makes sure that this maintains its aspect ratio.

func (Style) SetDelay Uses

func (style Style) SetDelay(delay float64)

SetDelay sets the animation delay of the attached animation.

func (Style) SetDuration Uses

func (style Style) SetDuration(duration float64)

SetDuration sets the animation duration of the attached animation.

func (Style) SetExpand Uses

func (style Style) SetExpand(expand float64)

SetExpand sets this element to expand and take up all available space.

func (Style) SetFont Uses

func (style Style) SetFont(font Font)

SetFont sets the font used by this element.

func (Style) SetFullyScrollable Uses

func (style Style) SetFullyScrollable()

SetFullyScrollable sets that this can be scrolled horizontally or vertically.

func (Style) SetGradient Uses

func (style Style) SetGradient(gradient Gradient)

SetGradient sets the color of this element to be a gradient moving in direction from start color to end color.

func (Style) SetHeight Uses

func (style Style) SetHeight(height unit.Unit)

SetHeight sets the desired height of this element.

func (Style) SetHidden Uses

func (style Style) SetHidden()

SetHidden sets this to be hidden and removed from flow.

func (Style) SetInnerSpacing Uses

func (style Style) SetInnerSpacing(x, y unit.Unit)

SetInnerSpacing sets the spacing within this element, takes em, vm, px or percentage values.

func (Style) SetInnerSpacingBottom Uses

func (style Style) SetInnerSpacingBottom(value unit.Unit)

SetInnerSpacingBottom sets the inner spacing bottom, takes a em, vm, px or a percentage value.

func (Style) SetInnerSpacingLeft Uses

func (style Style) SetInnerSpacingLeft(value unit.Unit)

SetInnerSpacingLeft sets the inner spacing left, takes a em, vm, px or a percentage value.

func (Style) SetInnerSpacingRight Uses

func (style Style) SetInnerSpacingRight(value unit.Unit)

SetInnerSpacingRight sets the inner spacing right, takes a em, vm, px or a percentage value.

func (Style) SetInnerSpacingTop Uses

func (style Style) SetInnerSpacingTop(value unit.Unit)

SetInnerSpacingTop sets the inner spacing top, takes a em, vm, px or a percentage value.

func (Style) SetInvisible Uses

func (style Style) SetInvisible()

SetInvisible sets this to be invisible.

func (Style) SetLayer Uses

func (style Style) SetLayer(layer int)

SetLayer sets the rendering layer.

func (Style) SetMaxHeight Uses

func (style Style) SetMaxHeight(height unit.Unit)

SetMaxHeight sets the max height of this element.

func (Style) SetMaxSize Uses

func (style Style) SetMaxSize(width, height complex128)

SetMaxSize sets the max width and height of the element. Takes em, vm, px or percentage values.

func (Style) SetMaxWidth Uses

func (style Style) SetMaxWidth(width unit.Unit)

SetMaxWidth sets the max width of this element.

func (Style) SetMinHeight Uses

func (style Style) SetMinHeight(height unit.Unit)

SetMinHeight sets the min height of this element.

func (Style) SetMinWidth Uses

func (style Style) SetMinWidth(width unit.Unit)

SetMinWidth sets the min width of this element.

func (Style) SetNotScrollable Uses

func (style Style) SetNotScrollable()

SetNotScrollable sets that this cannot be scrolled.

func (Style) SetOffsetBottom Uses

func (style Style) SetOffsetBottom(offset unit.Unit)

SetOffsetBottom sets the offset from an attached side, call this after an Attach().

func (Style) SetOffsetLeft Uses

func (style Style) SetOffsetLeft(offset unit.Unit)

SetOffsetLeft sets the offset from an attached side, call this after an Attach().

func (Style) SetOffsetRight Uses

func (style Style) SetOffsetRight(offset unit.Unit)

SetOffsetRight sets the offset from an attached side, call this after an Attach().

func (Style) SetOffsetTop Uses

func (style Style) SetOffsetTop(offset unit.Unit)

SetOffsetTop sets the offset from an attached side, call this after an Attach().

func (Style) SetOpacity Uses

func (style Style) SetOpacity(opacity float64)

SetOpacity sets the opacity/transparency of this element.

func (Style) SetOuterSpacing Uses

func (style Style) SetOuterSpacing(x, y unit.Unit)

SetOuterSpacing sets the outer spacing of this element, takes em, vm, px or percentage values.

func (Style) SetOuterSpacingBottom Uses

func (style Style) SetOuterSpacingBottom(value unit.Unit)

SetOuterSpacingBottom sets the outer spacing bottom, takes a em, vm, px or a percentage value.

func (Style) SetOuterSpacingLeft Uses

func (style Style) SetOuterSpacingLeft(value unit.Unit)

SetOuterSpacingLeft sets the outer spacing left, takes a em, vm, px or a percentage value.

func (Style) SetOuterSpacingRight Uses

func (style Style) SetOuterSpacingRight(value unit.Unit)

SetOuterSpacingRight sets the outer spacing right, takes a em, vm, px or a percentage value.

func (Style) SetOuterSpacingTop Uses

func (style Style) SetOuterSpacingTop(value unit.Unit)

SetOuterSpacingTop sets the outer spacing top, takes a em, vm, px or a percentage value.

func (Style) SetRoundedCorners Uses

func (style Style) SetRoundedCorners(radius unit.Unit)

SetRoundedCorners sets this element to have rounded corners of the specified radius.

func (Style) SetRoundedCornersBottom Uses

func (style Style) SetRoundedCornersBottom(radius unit.Unit)

SetRoundedCornersBottom sets this element to have rounded corners of the specified radius.

func (Style) SetRoundedCornersLeft Uses

func (style Style) SetRoundedCornersLeft(radius unit.Unit)

SetRoundedCornersLeft sets this element to have rounded corners of the specified radius.

func (Style) SetRoundedCornersRight Uses

func (style Style) SetRoundedCornersRight(radius unit.Unit)

SetRoundedCornersRight sets this element to have rounded corners of the specified radius.

func (Style) SetRoundedCornersTop Uses

func (style Style) SetRoundedCornersTop(radius unit.Unit)

SetRoundedCornersTop sets this element to have rounded corners of the specified radius.

func (Style) SetRow Uses

func (style Style) SetRow()

SetRow sets this element to behave like a row when rendering children (rendering them horizontally).

func (Style) SetScrollable Uses

func (style Style) SetScrollable()

SetScrollable sets that this can be scrolled vertically.

func (Style) SetShadow Uses

func (style Style) SetShadow(shadow Shadow)

SetShadow sets the elements style to match the Shadow defintion.

func (Style) SetSize Uses

func (style Style) SetSize(width, height complex128)

SetSize sets the width and height of the element. Takes em, vm, px or percentage values.

func (Style) SetTextColor Uses

func (style Style) SetTextColor(color color.Color)

SetTextColor sets the text color for this element.

func (Style) SetTextShadow Uses

func (style Style) SetTextShadow(shadow Shadow)

SetTextShadow sets the elements text style to match the Shadow defintion.

func (Style) SetTextSize Uses

func (style Style) SetTextSize(size complex128)

SetTextSize sets the Text Size, a multiple of the default text size.

func (Style) SetTint Uses

func (style Style) SetTint(c color.Color)

SetTint sets the tint of a icon to a certain color.

func (Style) SetUnshrinkable Uses

func (style Style) SetUnshrinkable()

SetUnshrinkable means this element should not shrink to make space for other elements.

func (Style) SetVisible Uses

func (style Style) SetVisible()

SetVisible sets this to be not hidden and visible.

func (Style) SetWidth Uses

func (style Style) SetWidth(width unit.Unit)

SetWidth sets the desired width of this element.

func (Style) SetZoomable Uses

func (style Style) SetZoomable()

SetZoomable sets the style to be zoomable on touch screens. DOES NOT WORK.

func (Style) Shrink Uses

func (style Style) Shrink()

Shrink means this element should shrink to make space for other elements.

func (Style) StickyToScreen Uses

func (style Style) StickyToScreen() Attacher

StickyToScreen sticks this element to the screen, returns an attacher to specify where.

func (Style) Stretch Uses

func (style Style) Stretch()

Stretch causes the image to stretch.

func (Style) TextAlign Uses

func (style Style) TextAlign() TextAligner

TextAlign returns a TextAligner for aligning text.

func (*Style) Translate Uses

func (style *Style) Translate(x, y complex128)

Translate the element by the given x and y values. This overrrides any previous calls to Translate.

func (Style) Wrap Uses

func (style Style) Wrap()

Wrap causes the children elements of this element to wrap like text.

func (Style) WrapSpacing Uses

func (style Style) WrapSpacing() Spacer

WrapSpacing distributes spacing to wrapped lines of children of this seed..

type TextAligner Uses

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

TextAligner aligns text.

func (TextAligner) Center Uses

func (a TextAligner) Center()

Center aligned text.

func (TextAligner) Left Uses

func (a TextAligner) Left()

Left aligned text.

func (TextAligner) Right Uses

func (a TextAligner) Right()

Right aligned text.

Directories

PathSynopsis
cssThis file is computer-generated
css/generate
style

Package style imports 11 packages (graph) and is imported by 6 packages. Updated 2020-03-19. Refresh now. Tools for package owners.